[PATCH 2/3] msvcrt: Implement Concurrency::event

Sebastian Lackner sebastian at fds-team.de
Mon Mar 13 16:59:01 CDT 2017


On 13.03.2017 22:33, Daniel Lehman wrote:
>> Not sure if its suitable here, but please note that Wines threadpool implementation also supports waiting on more than 64 objects (using similar tricks). If possible, it would be better to avoid the second implementation.
> 
> Not sure what you mean.  Are you talking about timerqueue_thread_proc?  
> 

I'm talking about CreateThreadpoolWait/SetThreadpoolWait or the corresponding
ntdll functions TpAllocWait/TpSetWait. Each wait handle would have to be added
separately, but there is no limitation for the number of handles. Also see
dlls/ntdll/tests/threadpool.c:test_tp_multi_wait for an example how it can be
used.

Nevertheless, after more careful reviewing in your patch, it looks like
handles are never really exposed to the application, is that correct? I'm not
really sure why you need a separate thread then. Why does event_set for
example not wake up the the pending waits directly? You have to be careful
when locking multiple critical sections, but I do not see any reason why it
shouldn't be possible.

Best regards,
Sebastian




More information about the wine-devel mailing list