THINK FIRST·CODE LATER

← All labs

Midterm practice: one workload, five algorithms

Problem

Work by hand (then check with lab OS4.1). Workload (times in ms; priority 1 = highest):

Process Arrival Burst Priority
A 0 3 2
B 2 6 1
C 4 4 3
D 6 5 2
E 8 2 1

For FCFS, SJF (non-preemptive), SRTF, preemptive priority and RR (q = 2):

  1. Draw the Gantt chart (write the ready queue at each decision point).
  2. Compute each process's finish, turnaround, waiting and response time, and the averages.
  3. Count the context switches.

Then answer:

  1. Which algorithm is best for average waiting, which for average response, and why?
  2. The EdgeCampus login service is interactive, while the nightly report generator is batch. Which algorithm would you choose for each, and what would change if context switches cost 0.5 ms?

Work it out on paper, in a document or here, then compare with the model answer. Your answer stays in your browser — it is never sent to or stored on the server.