linux - Incrementing Clocks -
when process set run initial time slice of 10 example, in hardware should know initial timeslice , decrement , when time slice turns 0, interrupt should fired!
in freebsd kernel, understand hardclock , softclock task of accounting. question is, decrementing of clock parallel execution of process?
i'll use pit example here, because it's simplest timing mechanism (and has been around quite while).
also, answer x86-specific; , os-agnostic. don't know enough internals of freebsd , linux answer them specifically. else might more capable of that.
essentially, timeslice "decremented" parallel execution of process timer creates irq each "tick" (note timers such hpet can 'one-shot' mode, fires irq after specific delay, can used scheduling well). once timeslice decrements zero, scheduler notified , task switch occurs. happens "at same time" process: irq jumps in, runs code, lets process keep going until timeslice runs out.
it should noted that, speaking, don't see process running end of it's timeslice task switches can occur direct result of system call (for example, read disk blocks, or writing terminal).
Comments
Post a Comment