Rewriting the FIFO code

Ken Brown kbrown@cornell.edu
Wed Jan 23 15:51:00 GMT 2019


On 1/23/2019 8:05 AM, Corinna Vinschen wrote:
> On Jan 22 20:44, Ken Brown wrote:
>> On 12/26/2018 2:03 PM, Corinna Vinschen wrote:
>>> On Dec 26 14:00, Ken Brown wrote:
>>>> Thanks for the encouragement, and Happy Holidays to you too.  One question: In
>>>> the new AF_UNIX socket code you mostly used NT functions, but the existing FIFO
>>>> code uses Win32 functions.  Do you prefer NT functions for new code?
>>>
>>> The NT functions have some advantages over the Win32 functions.
>>> For instance, WaitNamedPipe is not interruptible, while
>>> NtFsControlFile(FSCTL_PIPE_WAIT) can be called asynchronously
>>> and then you can just wait for an event object via cygwait
>>> (see fhandler_socket_unix::wait_pipe_thread).
>>>
>>> So, in theory I'd prefer NT functions, but if you feel uncomfortable
>>> and just want to implement away, feel free to go ahead with Win32
>>> functions.
>>
>> I've decided to use Win32 functions for now, not because of discomfort but
>> because it allowed me to use more of the existing code.  I can always change
>> that later.
> 
> Sounds good to me.  Just... can we make the fifo pipes PIPE_NOWAIT, by
> any chance and make fhandler_fifo a derived class of fhandler_base?

Sure.

> In the long run I'd like to get rid of the dreaded
> fhandler_base_overlapped class.  It doesn't reflect POSIX nowait
> semantics correctly and using nonblocking pipes would drop the need for
> code like fhandler_base_overlapped::close.  Normal pipes should also run
> nonblocking ideally.
> 
>> I've got enough working now that I think my patches could use some review.  But
>> there's still a lot more to do.  I've attached the patches, but I could send
>> them to cygwin-patches instead if you prefer.
> 
> I'd like to get 2.12.0 out of the door and then we can start pulling
> your stuff, whenever you think the patches are ready for that.  In
> that case, send them to the patches list.
> 
> I reviewed the patches just visually for now, but this looks good to me
> so far, except for my begging above :}

Thanks.

Ken


More information about the Cygwin-developers mailing list