Implementing Concurrency

Multitasking is a key feature in almost all operating systems; it increases the efficiency of the CPU and utilizes resources in a better manner. Threads are the best way to implement multitasking. A process can contain more than one thread to implement multitasking. 

In this chapter, we will cover the following recipes involving threads:

The terms process and thread can be confusing, so first, we'll make sure that you understand them.