0% found this document useful (0 votes)
12 views

Tutorial 04

This document discusses CPU scheduling algorithms and asks questions about distinguishing I/O-bound and CPU-bound programs, preemptive vs non-preemptive scheduling, examples of scheduling processes using FCFS, SJF, and RR algorithms, and differences between FCFS and RR in favoring short processes. It also provides examples to draw Gantt charts and calculate waiting times for non-preemptive SJF, priority, and round robin scheduling.

Uploaded by

1221301985
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)
12 views

Tutorial 04

This document discusses CPU scheduling algorithms and asks questions about distinguishing I/O-bound and CPU-bound programs, preemptive vs non-preemptive scheduling, examples of scheduling processes using FCFS, SJF, and RR algorithms, and differences between FCFS and RR in favoring short processes. It also provides examples to draw Gantt charts and calculate waiting times for non-preemptive SJF, priority, and round robin scheduling.

Uploaded by

1221301985
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
You are on page 1/ 1

TSN2101 – Tutorial 4 (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

a) Draw the Gantt charts illustrating the execution of these processes using FCFS, Non-
Preemptive SJF and RR (quantum=2) scheduling.
b) What is the turnaround time of each process for each of the scheduling algorithms?
c) What is the waiting time of each process for each of the scheduling algorithms?
d) Which of the schedules in Q3 results in the minimal average waiting time (over all
processes)?

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

a) FCFS
b) RR

5. Consider the following processes with the length of a CPU burst time given in milliseconds. The
processes are arrived according to the arrival time. (Low numbers represent high priority)

Process Arrival Time Priority Burst Time


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

a) Draw 3 (three) Gantt Charts illustrating the execution of these processors using scheduling.

i. Non-preemptive SJF
ii. Preemptive priority scheduling
iii. Round Robin (quantum=3) scheduling

b) Calculate the average waiting time for Pre – emptive priority and Round Robin Scheduling

You might also like