Assignment 2
Assignment 2
Assignment 2
ASSIGNMENT 2
Q1. What advantage is there in having different time-quantum sizes at different levels of a
multilevel queueing system?
Q2. Suppose that a CPU scheduling algorithm favors those processes that have used the least
processor time in the recent past. Why will this algorithm favor I/O-bound programs and yet not
permanently starve CPU-bound programs?
Q3. Suppose that the following processes arrive for execution at the times indicated. Schedule
these process as per given algorithms and show the results by drawing Gantt charts and
calculating the average waiting time for the following scheduling algorithms?
a. Time quantum for Round Robin and Priority scheduling is 3ns.
Q4. The following processes are being scheduled using a preemptive, round robin scheduling
algorithm. Each process is assigned a numerical priority, with a higher number indicating
a higher relative priority. In addition to the processes listed below, the system also has an
idle task (which consumes no CPU resources and is identified as Pidle ). This task has
priority 0 and is scheduled whenever the system has no other available processes to run.
The length of a time quantum is 10 units. If a process is preempted by a higher-priority
process, the preempted process is placed at the end of the queue.
Process Priority Arrival Time Burst Time
P1 3 0 5
P2 1 3 9
P3 2 6 2
P4 1 8 7
P5 3 9 4
Q5. Five batch jobs, A through E, arrive at a computer center at essentially the same time.
They have an estimated running time of 15, 9, 3, 6, and 12 minutes, respectively. Their
(externally defined) priorities are 6, 3, 7, 9, and 4, respectively, with a lower value corresponding
to a higher priority. For each of the following scheduling algorithms, determine the turnaround
time for each process and the average turnaround for all jobs. Ignore process switching overhead.
Explain how you arrived at your answers. In the last Three cases, assume only one job at a time
runs until it finishes, and all jobs are completely Processor bound.
a. round robin with a time quantum of 1 minute
b. priority scheduling
c. FCFS (run in order 15, 9, 3, 6, and 12)
d. shortest job first