Can I partition the C# System.Threading.ThreadPool?

Posted by Drew Shafer on Stack Overflow See other posts from Stack Overflow or by Drew Shafer
Published on 2011-02-15T15:17:42Z Indexed on 2011/02/15 15:25 UTC
Read the original article Hit count: 316

Filed under:
|

I love ThreadPool. It makes my life better. However, my love may have quietly turned into an abusive relationship that I need to escape from, so I need some advice from my SO brothers (and presumably sisters, although I haven't seen any actual evidence of that yet).

My basic problem is that I have several different libraries that are all using the threadpool in an uncoordinated way, and running out of threads is a possibility. I was hoping there was some way I could partition the ThreadPool up so I could give a certain class 1 thread, another 20 threads, another 5 threads, and so on.

I know I could write my own ThreadPool implementation. I don't want to do that, because I'm lazy. So, is there a simple solution already out there?

Currently I'm constrained to using the 3.5 CLR. I know a lot of this stuff becomes easier in 4.0.

© Stack Overflow or respective owner

Related posts about c#

Related posts about threadpool