[PATCH 3/4] server: Don't block when writing to named pipes in PIPE_NOWAIT mode.

Jacek Caban jacek at codeweavers.com
Tue Oct 1 13:38:50 CDT 2019


On 10/1/19 8:21 PM, Brendan Shanks wrote:
>> On Oct 1, 2019, at 9:51 AM, Jacek Caban <jacek at codeweavers.com> wrote:
>>
>> On 10/1/19 6:16 PM, Brendan Shanks wrote:
>>> +                wake_message( message, message->iosb->in_size );
>>> +            else if (message->async && (pipe_end->flags & NAMED_PIPE_NONBLOCKING_MODE))
>>> +                wake_message( message, 0 );
>>
>> Note that this will terminate write async, but leave the message queued. Is it intended to do that?
> No it’s not, thanks for catching that. Would I just need to call free_message() after wake_message()?


Note that there is one more problem with this: there may be a pending 
read, which current write may satisfy and thus complete without 
blocking. It would really need tests to be sure, but I'd expect that we 
should check if the call will block before queuing it. It may be useful 
to keep track of total pending read quota in pipe end, but that's just a 
guess without tests.


Jacek




More information about the wine-devel mailing list