5.7. Coordination Data Structures and Threading Enhancements

In .NET 4.0, the thread pool has been enhanced, and a number of new synchronization classes have been introduced.

5.7.1. Thread Pool Enhancements

Creating many threads to perform small amounts of work can actually end up taking longer than performing the work on a single thread. This is due to time slicing and the overhead involved in locking, and adding and removing items to the thread pools queue.

Previously, the queue of work in the thread pool was held in a linked list structure and utilized a monitor lock. Microsoft improved this by changing to a data structure that is lock-free and involves the garbage collector (GC) doing less work. Microsoft says that this new structure is ...

Get Introducing .NET 4.0: with Visual Studio 2010 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.