Operating System
Operating System
1. For the following processes, draw Gantt chart to illustrate the execution using,
a) Preemptive priority scheduling
b) Non-Preemptive priority scheduling.
Also Calculate average waiting time and average turnaround time. (Assumption: A larger priority number has
higher priority.)
2. Consider the set of 5 processes whose arrival time and burst time are given below. If the CPU scheduling policy is
FCSF, SJF pre-emptive, SJF non -pre-emptive calculate the average waiting time and average turnaround time.
3. Consider the set of 6 processes whose arrival time and burst time are given. If the CPU scheduling policy is
shortest remaining time first, calculate the average waiting time and average turnaround time.
4. Consider the set of 5 processes whose arrival time and burst time are given below. If the CPU scheduling policy is
Round Robin with time quantum = 2 unit, calculate the average waiting time and average turnaround time.
5. Consider the set of 5 processes whose arrival time and burst time are given below. If the CPU scheduling policy is
priority non-preemptive, calculate the average waiting time and average turnaround time. (Higher number
represents higher priority).
Process Id Arrival time Burst time Priority
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5
6. Five batch jobs A to E arrive at same time. They have estimated running times 10, 2, 6, 8, 4 minutes. Their
priorities are 3, 2, 5, 4, 1 respectively with 5 being highest priority. For each of the following algorithm determine
mean process turnaround time. Ignore process swapping overhead. Round Robin (q=3), Priority Scheduling, FCFS,
SJF.
7. Five batch jobs A to E arrive at same time. They have estimated running times 10,6,2,4 and 8 minutes. Their
priorities are 3,5,2,1 and 4 respectively with 5 being highest priority. For each of the following algorithm
determine mean process turnaround time. Ignore process swapping overhead. Round Robin (q=2), Priority
Scheduling, FCFS, SJF.
8. Consider the given snapshot of a system with five processes (P0, P1, P2, P3, P4) and three Resources (A, B, C).
13.Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given:
45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 49. Calculate the net
head movement using:
a) SSTF
b) SCAN
c) CSCAN
d) LOOK
14.A hard disk having 2000 cylinders, numbered from 0 to 1999. The drive is currently serving the request at cylinder
143, and the previous request was at cylinder 125. The status of the queue is as follows 86, 1470, 913, 1774, 948,
1509, 1022, 1750, 130 What is the total distance (in cylinders) that the disk arm moves to satisfy the entire
pending request for each of the following disk scheduling algorithms?
a) SSTF
b) FCFS
15.Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at
cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is - 86,
1470, 913, 1774, 948, 1509, 1022, 1750, 130. Starting from the current head position, what is the total distance
(in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk scheduling
– FCFS , SCAN ( elevator).
16.Disk requests come in to the disk for cylinders 10, 22, 20, 2, 40, 6 and 38. A seek takes 6 msec per cylinder move.
How much seek time is for Closest cylinder next algorithm? Initially arm is at cylinder 20. Starting track at 100.The
queue of pending request is, 55,58,39,18,90,160,150,38,184 – FCFS, SCAN ( elevator), SSTF,C SCAN
17.Suppose that a disk drive has 1000 cylinders, numbered 0 to 999. Assume last request received was at track 345
and the head is moving towards track 0. The queue of pending requests, in FIFO order, is
123,874,692,475,105,367. Perform following scheduling algorithm. FIFO, SSTF, SCAN, LOOK, C-SCAN, C-LOOK
18.Disk request come in to the driver for cylinder 10, 22, 20, 2, 40, 6 and 38. A seek takes 6 msec per cylinder moved.
How much seek time needed for FCFS, Closet cylinder next diagram. Initially arm is at cylinder 20.Starting track at
100. The queue of pending request is, 27,129,110,186,147,41,10,63,120 – SSTF, C-SCAN, C-LOOK.
19.Disk head is start at 53. The queue of pending request is, 98,183, 37,122,14,124,65,67. - FCFS, SSTF, SCAN, C-
SCAN, LOOK
20.Suppose that a disk drive has 5000 cylinders, numbered 0 through 4999.The drive is serving a request at cylinder
143. FIFO order is, 86, 1470, 913, 1774,948,1509,1022,1750,130 starting from head position. What is total
distance? FCFS, SSTF, SCAN, LOOK, C-SCAN, C-LOOK.