levo

Systems Software

Scheduling algorithms: shortest remaining time, multi-level feedback queues, traces and choosing an algorithm

  • 1 thing to know
  • Component 01

Overview

Recall questions on shortest remaining time and multi-level feedback queues, knowing burst times in advance, traces comparing first come first served, shortest job first, shortest remaining time and round robin, starvation, and justifying a scheduling algorithm.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is starvation, and which scheduling algorithms can cause it?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    How does shortest remaining time scheduling work?

    Model answer

    It is the pre-emptive form of shortest job first. The scheduler always runs the process with the smallest remaining burst time. Whenever a new process arrives, its burst time is compared with the remaining time of the running process, and if the new one is shorter the running process is pre-empted and returned to the ready queue.

  2. 2

    What does shortest remaining time optimise for, and what are its failure modes?

    Model answer

    It gives the best average turnaround time of the standard algorithms, because short jobs are always cleared out of the way quickly. Its failure modes are the same starvation problem as shortest job first but worse, since a long job can be pre-empted repeatedly and may never finish while short jobs keep arriving; the continuing need to know or estimate burst times; and extra overhead, because the scheduler must re-evaluate the choice every time a process arrives, causing more context switches.

  3. 3

    How do multi-level feedback queues work?

    Model answer

    Several ready queues are maintained, each with a different priority and often a different time slice length. A new process joins the highest-priority queue. If it uses up its whole time slice without finishing, it is moved down to a lower-priority queue with a longer time slice; if it gives up the processor early to wait for input or output, it stays at its level or moves up. The processor always serves the highest-priority non-empty queue, so a process's priority is set by its observed behaviour rather than by a figure supplied in advance.

  4. 4

    What do multi-level feedback queues optimise for, and what is the failure mode?

    Model answer

    They optimise for a good compromise: short and interactive processes, which give up the processor quickly, stay in the high-priority queues and get fast response, while long processor-bound jobs drift down and are run in longer, less frequent bursts, which reduces context-switching overhead for them. The failure mode is starvation of the lowest queues if high-priority work keeps arriving; real implementations counter this by periodically promoting all processes back to the top queue. They are also much more complex to design and tune than the other algorithms.

  5. 5

    Which scheduling algorithm needs to know the burst time in advance, and why is that a problem?

    Model answer

    Shortest job first and shortest remaining time both need the burst time, and shortest remaining time needs the remaining time too. The problem is that a general-purpose operating system cannot know how long a process will run before it runs it; it can only estimate, usually from how long similar or previous bursts from that process took. If the estimate is wrong the algorithm makes poor choices, and a process could in principle be written to understate its needs to gain priority.

  6. 6

    Three processes arrive: A at time 0 needing 6 ms, B at time 1 needing 3 ms, C at time 2 needing 2 ms. Trace first come first served and give the average turnaround time.

    Model answer

    Order of service is A, B, C. A runs 0-6, B runs 6-9, C runs 9-11. Completion times are A 6, B 9, C 11. Turnaround is completion minus arrival: A 6 - 0 = 6, B 9 - 1 = 8, C 11 - 2 = 9. Average turnaround = (6 + 8 + 9) / 3 = 23/3 = 7.67 ms.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

See a huge jump in your memorisation

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It trains answer structure

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Systems Software, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.