February 2018
Intermediate to advanced
552 pages
13h 46m
English
Concurrency means executing multiple tasks at a time, by utilizing the underlying multi-core CPUs effectively. However, at any given point of time, only one task uses the CPU cores and the rest wait for their turn. They get timeslots to use the CPU and fulfill their job. This interleaving of timeslots and utilizing the CPU is known as context switching.

As shown in the preceding diagram, even though there are n number of queues for threads to use CPU cores and perform their job, only one thread will enter the final slot and use the CPU. The rest of the threads will wait in the CPU. The user may ...
Read now
Unlock full access