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 - C++ Tutorial
From the course: Parallel and Concurrent Programming with C++ Part 1
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Thread versus process4m 36s
-
Thread versus process: C++ demo6m 11s
-
(Locked)
Concurrent versus parallel execution4m 54s
-
(Locked)
Execution scheduling3m 38s
-
(Locked)
Execution scheduling: C++ demo2m 27s
-
(Locked)
Thread life cycle3m 35s
-
(Locked)
Thread life cycle: C++ demo4m 29s
-
(Locked)
Detached thread2m 49s
-
(Locked)
Detached thread: C++ demo1m 52s
-
-
-
-
-