[Mono-dev] WaitAny does not consistently return when waiting on more than one WaitHandle
Tom Philpot
tom.philpot at logos.com
Wed Nov 25 18:01:42 EST 2009
We've written a small test case against Mono 2.7 (r146315) that confirms
that WaitAny() does not return in a consistent amount of time, or sometimes
at all when waiting on more than one WaitHandle. It also appears that there
are no test cases in Mono for this case.
Our attached program takes 2 arguments. The first is the number of
milliseconds to wait before the wait handles are set, the second is the
number of milliseconds to wait in before exiting to give the thread pool
time to notify.
We're running these tests on Mac OS X, if that helps.
Example of Failure case:
ws1048:Mono Patches tom.philpot$ /opt/mono/bin/mono WaitAnyTest.exe 35000
10000
Setup wait handles, sleeping for 35s...
Wait2: Calling WaitAny with 2 WaitHandles
Wait1: Calling WaitAny with 1 WaitHandle
done sleeping.
Setting event 2.
Sleeping for 10s to see if wait handles respond.
Wait1: WaitAny(1) returned 0.
Example of Successful case:
ws1048:Mono Patches tom.philpot$ /opt/mono/bin/mono WaitAnyTest.exe 5000
10000
Setup wait handles, sleeping for 5s...
Wait1: Calling WaitAny with 1 WaitHandle
Wait2: Calling WaitAny with 2 WaitHandles
done sleeping.
Setting event 2.
Sleeping for 10s to see if wait handles respond.
Wait1: WaitAny(1) returned 0.
Wait2: WaitAny(2) returned 1.
RegisteredWaitForSingleObjectCallback called.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WaitAnyTest.cs
Type: application/octet-stream
Size: 2261 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091125/2d697ae9/attachment.obj
More information about the Mono-devel-list
mailing list