Andras Csehi Andras Csehi - 25 days ago 8
C# Question

Maximum queued elements in ThreadPool.QueueUserWorkItem

I set the max thread to 10. Then I added 22000 task using ThreadPool.QueueUserWorkItem.
It is very likely that not all the 22000 task was completed after running the program. Is there a limitation how many task can be queued for avaiable threads?

Answer

The queue has no practical limit however the pool itself will not exceed 64 wait handles, ie total threads active.