Programming with Threads
Asynchronous programming provides you with access to lightweight multithreading. The ThreadPool and Thread classes provide you with heavyweight multithreading. The ThreadPool class manages a collection of worker-thread objects waiting for work. Because ThreadPool has threads waiting around, this class may be more efficient to use. Alternatively, you can use the Thread class directly, but while this gives you a little more control, the Thread class also requires more responsibility.
As a general practice there is no reason why you cannot use the ThreadPool class for all your threading needs. The ThreadPool class is a bit easier to use, and you will get the same multithreaded performance results with a bit less work than ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access