From the course: Complete Guide to Parallel and Concurrent Programming with C++
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Execution scheduling - C++ Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming with C++
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 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 to make the most use of the additional resources. A process will run until…
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
-
-
-
-
-
-
-
-
-
-
-