[PATCH v2 2/2] ntdll: sock_recv keeps message ordered

Zebediah Figura zfigura at codeweavers.com
Fri Dec 10 14:59:17 CST 2021


On 12/9/21 21:01, Dongwan Kim wrote:
>> This will, however, introduce an extra server call in some cases.
>> Specifically, if there is already data available (and we are the first
>> in line) we currently make two server calls (one to report
>> STATUS_SUCCESS to the server, and one to select on the async handle).
>> With this change we'll make three. (Note that it looks like two, because
>> we're still doing a call to NtWaitForSingleObject, but being interrupted
>> by a kernel APC means we restart the select call.)
> 
> Actually, I can't understand why an extra server call occurs.
> It might be there's something I don't know.
> In this patch, I just added extra data about pending asyncs to existing apc_call data(apc_call_t).
> At your example, there are no pending asyncs because we are the first in line. ( Do I understand correctly?)
> queue->read_q ( it is the structure created in this patch) was cleared to 0 when the last APC_ASYNC_IO came.
> So It would behave exactly the same with current wine in this situation.
> Please let me know what I missed.

Well, I'm referring to my proposal, i.e. "get rid of the initial 
try_recv". Your patch doesn't add any extra server calls, but it is 
broken since it doesn't account for read requests queued by other processes.



More information about the wine-devel mailing list