Hi guys,
Whenever i need to use threads in my apps, i always
have the same problem of choosing the right kind of
threads to create.
I never know whether to create threads by using:
1) The Thread class, which may create a new os thread
2) A delegate, which uses a thread from the thread pool
3) The ThreadPool, which uses the thread pool as well
Can anyone please shed some light on this subject?
Thanks,
Avi
Jon Skeet [C# MVP] - 30 May 2005 15:27 GMT
> Whenever i need to use threads in my apps, i always
> have the same problem of choosing the right kind of
[quoted text clipped - 5 lines]
>
> Can anyone please shed some light on this subject?
Or 4) using a thread pool other than the system one.
I would suggest only using the system ThreadPool for short operations
which definitely won't need to use the threadpool themselves - it's
easy to deadlock, as the framework libraries don't say which method
calls block on other thread pool threads.
I would usually advocate a custom thread pool or a new thread.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too