Geeks With Blogs
Ritesh Singh's Programming Blog .Net and more December 2014 Entries
ThreadPool’s QueueUserWorkItem does not queue
The other day I noticed that although the ThreadPool class contains a method called QueueUserWorkItem there is no guarantee that it will run functions in the order that they are queued. The code below was run on LinqPad and as you can see there are four methods Fast1, Fast2, Slow1 and Slow2. Even though I’ve called them in that order the ThreadPool is not running them in that order. Something to be aware of if you’re using the QueueUserWorkItem method. Each time I ran the code above the functions ......

Posted On Sunday, December 7, 2014 12:18 PM

Copyright © BikerDev | Powered by: