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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -