Chapter 14. Multithreading
In the managed world of the common language runtime, the fundamental unit of execution is the thread. A managed application begins its life as a single thread but can spawn additional threads to help it carry out its appointed mission. Threads running concurrently share the CPU (or CPUs) by using scheduling algorithms provided by the system. To an observer, it appears as if all the threads are running at once. In reality, they simply share processor time—and do so very efficiently.
Why would an application spawn additional threads? Multithreading is a mechanism for performing two or more tasks concurrently. Tasks executed by threads running side by side on a single-CPU system don’t execute any faster; CPU time is, after ...
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