c# - WaitAll limitation -
i heard there limitation when using waitall on multiple threads (# of threads wait?). can give details?
i think restriction referring not on number of threads; on number of handles being waited on. msdn page waithandle.waitall(waithandle[])
:
on implementations, if more 64 handles passed, notsupportedexception thrown.
on rare occasion issue has cropped, have worked around with:
waithandle[] handles = ... foreach(var waithandle in handles) waithandle.waitone();
for completeness, other restrictions appear be:
if array contains duplicates, call fails duplicatewaitobjectexception.
the waitall method not supported on threads have stathreadattribute.
Comments
Post a Comment