Chapter 29. Primitive Thread Synchronization Constructs

In this chapter:

Class Libraries and Thread Safety

Primitive User-Mode and Kernel-Mode Constructs

User-Mode Constructs

Kernel-Mode Constructs

When a thread pool thread blocks, the thread pool creates additional threads, and the time and memory resources required to create, destroy, and schedule threads is very expensive. When many developers see that they have threads in their program that are not doing anything useful, they tend to create more threads in hopes that the new threads will do something useful. The key to building scalable and responsive applications is to not block the threads you have so that they can be used and reused to execute other tasks. Chapter 27, focused on how to use existing ...

Get CLR via C#, Fourth Edition now with O’Reilly online learning.

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