ThreadPool limitation

  • Thread starter Thread starter Joel Lyons
  • Start date Start date
J

Joel Lyons

I am using Async delegates to make many RPC calls (each of which will take a
max of a couple seconds). This seemed acceptable since the threads aren't
really doing much on the local machine (the remote machines are doing all
the work).

Don't Async delegates actually use the thread pool? Doesn't this mean I'm
limited to 25 calls at a time?

Can I increase the size of the thread pool in my process?
Can I force the async delegates to use new threads instead of from the
thread pool?

Is there a better method for making many RPC calls?

-Joel
 
Joel,
Don't Async delegates actually use the thread pool?

Yes they do.

Doesn't this mean I'm limited to 25 calls at a time?

Per procesor, yes, if you use the default.

Can I increase the size of the thread pool in my process?

Yes, using the ICorThreadpool COM API.

http://staff.develop.com/woodring/dotnet/#tpcontrol

You could also use a custom thread pool

http://staff.develop.com/woodring/dotnet/#threadpool

Can I force the async delegates to use new threads instead of from the
thread pool?

No. Can't you explicitly create a new thread instead (if you really
want more than 25)?



Mattias
 
Back
Top