From the course: Parallel and Concurrent Programming with Java 1
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Execution scheduling - Java Tutorial
From the course: Parallel and Concurrent Programming with Java 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 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…
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 vs. process4m 36s
-
Thread vs. process: Java demo6m 48s
-
(Locked)
Concurrent vs. parallel execution4m 54s
-
(Locked)
Execution scheduling3m 38s
-
(Locked)
Execution scheduling: Java1m 57s
-
(Locked)
Thread lifecycle3m 36s
-
(Locked)
Thread lifecycle: Java demo4m 55s
-
(Locked)
Thread attributes: Java demo2m 22s
-
(Locked)
Runnable vs. thread: Java demo3m 53s
-
(Locked)
Daemon thread2m 49s
-
(Locked)
Daemon thread: Java demo2m 21s
-
-
-
-
-