From the course: Parallel and Concurrent Programming with C++ Part 1

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Execution scheduling

Execution scheduling - C++ Tutorial

From the course: Parallel and Concurrent Programming with C++ Part 1

Start my 1-month free trial

Execution scheduling

- Threads don't just execute whenever they want to. A computer might have hundreds of processes with thousands of threads that all want their turn to run on just a handful of processors. So, how do they decide who goes first? - That's the operating system's job. The OS includes a scheduler that controls when different threads and processes get their turn to execute on the CPU. The scheduler makes it possible for a multiple programs to run concurrently on a single processor. When a process is created and ready to run it gets loaded into memory and placed in the ready queue. Think of these as cooks in the kitchen that are ready to work. The scheduler is like the head chef that tells the other cooks when they get to use the cutting board. It cycles through the ready processes so they get a chance to execute on the processor. If there are multiple processors, then the OS will schedule processes to run on each of them…

Contents