ThreadPool limitation

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
 
M

Mattias Sjögren

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top