threading question

S

Sougato Das

I just finished chapter 19 on threading in Wrox's 'Professional VB .NET".
The chapter describes two basic things:
1.. Creating/maintaining your own threads
2.. Creating 'worker' objects and letting Windows decide when to allocate
threads to them from Windows' thread pool
I think the overall assertion is that for a service-type application, it's
better to use the latter.

So here's my question:

Say I have an application which needs to make say 100 phone calls to 100
different people (using VoIP) within say 5 minutes. Obviously, the calls
would have to run in parallel. Each call will relay a short message, say 30
seconds long. Would you suggest that such an application use a thread pool
(as in #2, above), or would you suggest creating threads myself (as in #1
above) and just experimenting to see what the optimal number of threads is
with the current hardware?

Thanks for your time,

Sougato
 
C

CJ Taylor

Depends on how you want to deal with the result and do your management. IF
its just phone calls, you can have your worker object itself deal with the
result, otherwise, you would manage your own threads.

but for this situation, I think a thread pool would be your best option.

-cJ
 

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