terminology - What is voluntary preemption? -
what voluntary preemption? know it's concept in scheduling.
it depends little bit on os.
in rtos, voluntary preemption means running process declares points can preempted (where otherwise run until completion). way think of variant of yield in coroutine. in contrast desktop os kernel determines preemption. keep in mind rtos not have concept of "user mode".
in linux (at least), "voluntary preemption" bit of misnomer:
traditionally (no forced preemption), when user process making system call (in kernel mode), block until completion. user mode code preempted.
the preemptive kernel such kernel code can preempted. sounds redundant it's worth noting mean kernel preemptible, not "the kernel supports preemption". forced/involuntary preemption means while servicing system call, interrupt high priority user process can "force" kernel context switch run (technically it's not context switch, has same effect). decreases latency of user process "seeing" change in hardware state.
voluntary preemption kernel periodically checks see if should reschedule processes "while doing kernel things". is, instead of scheduling/rescheduling user processes @ preemption points, periodically while handling things such i/o. so, high priority user process might still have wait low priority process finish slice, high prioirty process might run "early" kernel checking more if it's run. decreases latency of user process moving suspended state running state (at expense of overall system throughput).
Comments
Post a Comment