Thread vs ThreadPool -.Net 2.0

I can not understand the difference between Thread vs ThreadPool. Think I have to manipulate 50,000 records using threads.

In the case of threads, I need to either predetermine the absence of threads or there are no entries in the threads. Any of them should be permanent.

In the case of threadpool, we do not need to install any of them theoretically. But in practice, we need to assign the number of records in the stream, because none of the streams can increase extremely large if the number of records in the record is huge.

Any ideas on this?

+1
multithreading threadpool
source share
2 answers

There is a huge cost to creating and destroying threads. The thread pool fixes this problem by maintaining open threads for you. When a thread in a pool executes with its work, the thread returns to the pool instead of being destroyed. Then, when you need to work harder, an already open thread is taken from the pool. It is much more efficient.

+1
source share

Here is a complete reference to Threads and ThreadPools that will answer your question. includes when to use one against the other.

http://www.yoda.arachsys.com/csharp/threads/

+2
source share

All Articles