OS Assignment 1
OS Assignment 1
Q1. Eight batch job A through H, arrive at a computer center at same time. They have estimated running time
(Processing time) of 10, 6, 2, 4, 8, 4, 3 and 6 minutes. Their (externally determined) Priority are 3, 5, 2, 1, 4, 2,
3 and 1 respectively, with 5 being the highest priority. For each of the following scheduling algorithms,
determine the mean process turnaround time, mean process waiting time. Ignore the process of switching
overhead.
A. First come first served (FCFS) algorithm
B. Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
C. Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
D. Non-preemptive priority scheduling algorithm
E. Preemptive priority scheduling algorithm
F. Round Robin (Time Quantum=2)
For F assume that the system is multi-programmed and that each job gets its fair share of CPU. For A and B
assume that only one job at a time run, until it finishes.
Q2. Consider the set of processes given in the table and the following scheduling algorithm:
1) First come first served (FCFS) algorithm
2) Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
3) Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
4) Non-preemptive priority scheduling algorithm
5) Preemptive priority scheduling algorithm
6) Round Robin (Time Quantum=3)
Assuming 0 to be the highest priority. Draw the Gantt chart and find the average waiting time, average
turnaround time, CPU utilization, throughput, response time for the algorithms. Comment on your result which
one is better and why?
Q3. Consider the set of processes given in the table and the following scheduling algorithm:
A. First come first served (FCFS) algorithm
B. Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
C. Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
D. Non-preemptive priority scheduling algorithm
E. Preemptive priority scheduling algorithm
F. Round Robin (Time Quantum=2)
Q4. Eight batch job A through H, arrive at a computer center at 01:00, 01:10, 02:10, 01:30, 02:30, 01:50,
02:10 and 02:30. They have an estimated running time (Processing time) of 5, 10, 2, 4, 8, 4, 6 and 2 minutes.
Their (externally determined) Priority are 3, 5, 2, 1, 4, 2, 3 and 1 respectively, with 5 being the highest priority.
For each of the following scheduling algorithms, determine the mean process turnaround time, mean process
waiting time, CPU utilization and Throughput. Ignore the process of switching overhead.
A. First come first served (FCFS) algorithm
B. Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
C. Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
D. Non-preemptive priority scheduling algorithm
E. Preemptive priority scheduling algorithm
F. Round Robin (Time Quantum=2)
For F assume that the system is multi-programmed and that each job gets its fair share of CPU. For A and B
assume that only one job at a time run, until it finishes.