Previous | Next --- Slide 10 of 44
Back to Lecture Thumbnails
firebb

I remember that in MIT's JOS lab, actually we would not implement the context switch by having a process acting as a monitor to interrupt each processor. Instead, each processor initially runs the kernel code and before trying to run a user thread, it sets a timer which would break from the user code back to kernel code later. Through this way each processor actively switches between different threads themselves without a central OS process scheduling all of this.

zale

I think that is how most modern OSes work, a.k.a. preemptive multitasking. Older operating systems often used cooperative multitasking, where the kernel runs the scheduler every time a process makes a system call (so they have to voluntarily relinquish control to the kernel).