Scheduler Activations
Parallelism
User | Kernel |
---|---|
Low overhead (Procedure call) | High overhead (Sys call) |
OS-oblivious | OS-aware |
Thread block, all blocked | I/O block, context switch to another |
Customizability | Generic |
PL uses both user and kernel threads
Let's say we run the code on a 4-CPU machine, the system will create 4 kernel threads first. Then all the use level threads will be put in a work queue, and run on the 4 kernel threads. It is multiplexed.
Problem
When a user-level thread makes a blocking I/O request or takes a page fault, the kernel thread serving as its virtual processor also blocks. As a result, the processor is idle.
Plausible Solution
Create more kernel threads than number of physical processor; When one kernel thread blocks because its user-level thread blocks in the kernel, another kernel thread is available to run user-level threads on that processor. But when the blocked user-level thread returns, there will be more runnable kernel threads than processors.
Scheduler Activations
"Fancy" kernel level threads. When blocked, notify, and run another use-level thread.
It notifies the user-level thread system of a kernel event, such as the user-level thread blocks or wakes up. It also provides space in the kernel for saving the processor context of the activation's current user-level thread.
When a user-level thread is blocked, create a new scheduler activation, upcall into the user-level scheduler. The user-level scheduler decides what is the next to run.