O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Thread Pools

Creation of new threads is a fairly expensive operation. The reason for this goes all the way down to the operating system tasks that have to be performed to make the creation of a new thread happen. This includes the allocation of the thread’s stack and various data structures (such as KTHREAD at the kernel mode level) to maintain the thread’s state. Also, the thread needs to become eligible for scheduling, requiring the scheduler database to be updated to gain knowledge about the thread’s existence.

Note: Kernel Mode Versus User Mode

Threads are the unit of code execution on the Windows operating system. This means that threads get scheduled and can deal with synchronization. Because the concept of preemptive scheduling requires ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required