10. Simple Schedulers Flashcards
What three pieces of information do some simple schedulers use to decide which thread to run next?
What will happen next, what just happened, and what does the user want
Describe the steps of random scheduling
First, choose a scheduling quantum (max amount of time a thread can run).
Second, choose a thread at random from the ready pile and run the thread until it blocks or the scheduling quantum expires.
Note: When a thread leaves the waiting state, it simply returns to the ready pile.
Describe the steps of round-robin scheduling.
First, choose a scheduling quantum (max amount of time a thread can run).
Second, establish an ordered ready queue (ex: when a thread is created add it to the tail of the ready queue).
Third, choose the thread at the head of the ready queue, run the thread until it blocks or its quantum expires, and if its quantum expires, place it at the tail of the ready queue.
Note: If a thread leaves the waiting state, put it either at the head or tail of the queue (be consistent)
What does it mean to be a “know nothing” scheduling algorithm?
They require no information about a thread’s past, present, or future, and they accept no user input.
What are some examples of know nothing scheduling algorithms?
Random and Round Robin schedulers.
What are the problems with know-nothing schedulers?
They fail to reward threads that voluntarily give up the CPU before their quantum expires and they are not capable of prioritizing important threads.
What kind of future-facing information might we want to know about a thread when making scheduling decisions?
How long it is going to use the CPU, whether it will block or yield, and how long the thread will need to wait if it blocks
Why would we prefer threads that give up the CPU before their time quantum ends?
they are probably waiting for something else (like a disc read), which can be done in parallel with CPU use
Describe the shortest-job first scheduling algorithm and why it is useful.
Shortest-job first schedules jobs in order of increasing runtime. This minimizes the total waiting time of all the processes that need to run.
What is MLFQ scheduling?
MLFQ stands for multi-level feedback queues. This type of scheduler employs multiple queues, each representing a priority.
The rotating staircase scheduler, developed by Con Kolivas is an example of an MLFQ scheduler.