0% found this document useful (0 votes)
8 views2 pages

CPU Scheduling Tutorial and Solutions

The document is a tutorial on CPU scheduling, discussing the importance of distinguishing between I/O-bound and CPU-bound programs, and explaining preemptive versus non-preemptive scheduling. It includes exercises involving Gantt charts for various scheduling algorithms such as FCFS, SJF, and RR, along with calculations for turnaround and waiting times. Additionally, it compares the discrimination of different scheduling algorithms in favor of short processes.

Uploaded by

zihanghay
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

CPU Scheduling Tutorial and Solutions

The document is a tutorial on CPU scheduling, discussing the importance of distinguishing between I/O-bound and CPU-bound programs, and explaining preemptive versus non-preemptive scheduling. It includes exercises involving Gantt charts for various scheduling algorithms such as FCFS, SJF, and RR, along with calculations for turnaround and waiting times. Additionally, it compares the discrimination of different scheduling algorithms in favor of short processes.

Uploaded by

zihanghay
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

FIST MULTIMEDIA UNIVERSITY

Tutorial 5 - CPU Scheduling

1. Why is it important for the scheduler to distinguish I/O-bound programs from


CPU-bound programs?

2. What is the difference between preemptive and non-preemptive scheduling?

3. Consider the following set of processes, with the length of the CPU-burst time
given in milliseconds:

Process Burst-time Arrival time


P1 10 0
P2 2 1
P3 3 2
P4 1 3
P5 5 4

Draw the Gantt charts illustrating the execution of these processes using:
a) FCFS
b) Non-Preemptive SJF
c) RR (quantum=2)

4.
a) What is the turnaround time of each process for each of the scheduling
algorithms in Q3?
b) What is the waiting time of each process for each of the scheduling algorithms
in Q3?
c) Which of the schedulers in Q3 results in the minimal average waiting time
(over all processes)?

5. Explain the difference in the degree to which the following scheduling algorithms
discriminate in favor of short processes.

a) FCFS
b) RR
c) Multilevel feedback queues

Operating Systems [TOS 6113] Tutorial 5 - Sol (5-1)


FIST MULTIMEDIA UNIVERSITY

6. Consider the following processes with the length of a CPU burst time given in
milliseconds. The processes arrived according to their arrival time.

Process Arrival Time Priority Burst Time


P0 0 2 8
P5 0 1 6
P1 4 5 15
P2 7 3 9
P4 9 4 13
P3 13 1 5

Draw Gantt Charts illustrating the execution of these processes using the
scheduling algorithms below:
a) Non preemptive SJF
b) Preemptive priority
c) Round robin (quantum = 3)
d) Calculate the average waiting time (AWT) for all three scheduling algorithms

Operating Systems [TOS 6113] Tutorial 5 - Sol (5-2)

You might also like