CSE 131 Chapter Notes - Chapter FreeBSD 4.4: Doubly Linked List, Context Switch, Bit Array
Document Summary
Scheduler is selected at the time the kernel is built. Runs every time a thread blocks and a new thread must be selected to run. Kernel maintains a set of run queues for each cpu. Low level scheduler selects a thread from the highest priority run queue when a task is blocked on the cpu. If multiple threads are on a queue, the system runs them in the order they are found on the queue. High level scheduler: runs not as frequently. Responsible for setting the thread priorities and deciding on which cpu"s run queue they should be placed in. Each cpu has its own set of run queues to avoid cpus from selecting the same thread to run. If a thread blocks, it is put on a sleep queue. If a thread uses up the time allowed, it is placed at the end of the queue from which it came. Shorter time quantum = better interactive response.