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

Chapter 5 Problems and Answers 5.9 Why Is It Important For The Scheduler To Distinguish Answer

The document contains answers to questions about scheduling algorithms: 1) It is important for the scheduler to distinguish I/O-bound and CPU-bound programs because I/O-bound programs do not fully utilize their CPU time, so giving priority to I/O-bound programs improves resource usage. 2) Gantt charts are provided showing the execution of 5 sample processes using FCFS, SJF, priority, and RR scheduling. SJF scheduling results in the lowest average wait time. 3) FCFS discriminates against short jobs, RR treats all jobs equally and favors short jobs, and multilevel feedback queues similarly favor short jobs.

Uploaded by

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

Chapter 5 Problems and Answers 5.9 Why Is It Important For The Scheduler To Distinguish Answer

The document contains answers to questions about scheduling algorithms: 1) It is important for the scheduler to distinguish I/O-bound and CPU-bound programs because I/O-bound programs do not fully utilize their CPU time, so giving priority to I/O-bound programs improves resource usage. 2) Gantt charts are provided showing the execution of 5 sample processes using FCFS, SJF, priority, and RR scheduling. SJF scheduling results in the lowest average wait time. 3) FCFS discriminates against short jobs, RR treats all jobs equally and favors short jobs, and multilevel feedback queues similarly favor short jobs.

Uploaded by

Gautham Nagendra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Chapter 5 Problems and Answers

5.9 Why is it important for the scheduler to distinguish I/O-bound programs


from CPU-bound programs?
Answer: I/O-bound programs have the property of performing only
a small amount of computation before performing I/O. Such programs
typically do not use up their entire CPU quantum. CPU-bound programs,
on the other hand, use their entire quantum without performing any
blocking I/O operations. Consequently, one could make better use of the
computers resources by giving higher priority to I/O-bound programs
and allow them to execute ahead of the CPU-bound programs.

5.12 Consider the following set of processes, with the length of the CPU-burst
time given in milliseconds:
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5,
all at time 0.
a. Draw four Gantt charts illustrating the execution of these processes
using FCFS, SJF, a non-preemptive priority (a smaller priority number
implies a higher priority), and RR (quantum = 1) scheduling.
b. What is the turnaround time of each process for each of the scheduling
algorithms in part a?
c. What is the waiting time of each process for each of the scheduling
algorithms in part a?
d. Which of the schedules in part a results in the minimal average
waiting time (over all processes)?
Answer:
a. The four Gantt charts are
123451351515151
12345
24351
25134
SJF
RR
FCFS
Priority
b. Turnaround time
FCFS RR SJF Priority
P1 10 19 19 16
P2 11 2 1 1
P3 13 7 4 18
P4 14 4 2 19
P5 19 14 9 6
c. Waiting time (turnaround time minus burst time)
FCFS RR SJF Priority
P1 0 9 9 6
P2 10 1 0 0
P3 11 5 2 16
P4 13 3 1 18
P5 14 9 4 1
d. Shortest Job First

5.18 Explain the differences in the degree to which the following scheduling
algorithms discriminate in favor of short processes:
a. FCFS
b. RR
c. Multilevel feedback queues
Answer:
a. FCFSdiscriminates against short jobs since any short jobs arriving
after long jobs will have a longer waiting time.
b. RRtreats all jobs equally (giving them equal bursts of CPU time)
so short jobs will be able to leave the system faster since they will
finish first.
c. Multilevel feedback queues work similar to the RR algorithm
they discriminate favorably toward short jobs.

You might also like