[PATCH v4 4/8] server: Defer postprocessing until after setting initial status in send_socket handler.

Zebediah Figura zfigura at codeweavers.com
Thu Mar 10 13:06:30 CST 2022


On 3/10/22 10:46, Jinoh Kang wrote:
> On 3/8/22 03:11, Zebediah Figura wrote:
>>
>>
>> On 3/5/22 02:24, Jinoh Kang wrote:
>>> On 3/5/22 09:13, Zebediah Figura wrote:
>>>> But assuming that we only really need to clear flags when the kernel send buffer is full, I think the right thing to do would be to clear events if "async_waiting( &sock->write_q )".
>>>
>>> We still need to account for nonblocking I/O (STATUS_DEVICE_NOT_READY), and also is_short_write, which is another indicator for a full send buffer.  Otherwise, it breaks ws2_32:sock:test_write_events.
>>> Also, note the implicitly bound address.
>>>
>>> In any case I think the co-routine pattern is inevitable due to the client-server role split.  In this case, AFD.SYS can do both pre- and post-processing inside a single function, but wineserver can't block for the client to finish the I/O.
>>>
>>>
>> Right. Maybe we could make use of async_set_completion_callback() instead? I think the only reason that can't work is if the sock name needs to be updated and visible *before* the I/O is necessarily complete.
> 
> Are you comfortable with allocating new memory for callback private data?
> 
> 

In general, yes; we already do that for some asyncs. In fact the purpose 
of async_set_completion_callback() is usually to free that data.



More information about the wine-devel mailing list