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

Assignment 03

This document provides instructions and problems for an operating systems assignment. It contains 12 problems related to scheduling algorithms like FCFS, SJF, priority scheduling, and multilevel queue scheduling. Students are asked to analyze, compare, and simulate the behavior of these algorithms. They are also asked to calculate metrics like waiting time, turnaround time, throughput and CPU utilization for different scheduling scenarios. The document specifies the submission format and warns against plagiarism.

Uploaded by

Bilal Aamir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views

Assignment 03

This document provides instructions and problems for an operating systems assignment. It contains 12 problems related to scheduling algorithms like FCFS, SJF, priority scheduling, and multilevel queue scheduling. Students are asked to analyze, compare, and simulate the behavior of these algorithms. They are also asked to calculate metrics like waiting time, turnaround time, throughput and CPU utilization for different scheduling scenarios. The document specifies the submission format and warns against plagiarism.

Uploaded by

Bilal Aamir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Operating

Systems BCS Fall 17


Assignment 03
Date: 27-10-2019 Submission Date: 31-10-2019

Note 1: You may consult any book, website, senior, friend but write in your own language. Assignment
must be hand written A4 single sided pages. Submit assignment in start of class.
Note 2: Cheating is highly unethical and may result in zero marks in all assignments/ sessional, if
repeated may extend to 'F' grade in course.
Note 3: Try to write neat & clean, unreadable assignment will not be marked. However, no need of
binding, you can simply submit stapled papers with front page clearly mentioning assignment no,
subject, student name, roll no & finally PUCIT New Campus.
Note 4: Papers may have lines and students can write on both sides. Here, single sided is written just
for counting purpose.
PART-I (Check/Build your Concepts) [50 marks]
Problem 1
Suppose that a scheduling algorithm (at the level of short-term CPU scheduling) 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?
Problem 2
Why is it important for the scheduler to distinguish I/O-bound programs from CPU-bound programs?
Problem 3
Explain the working of Multi-level and Multi-level Feedback Queue and Differentiate between them?
What is the benefit of using Multi-level Feedback Queue?
Problem 4
Consider a system implementing multilevel queue scheduling. What strategy can a computer user
employ to maximize the amount of CPU time allocated to the user’s process?
Problem 5
Which of the following scheduling algorithms could result in starvation? Explain your answer:
a. FCFS
b. SJF
c. RR
d. Priority
Problem 6
Explain the differences in how much the following scheduling algorithms discriminate in favor of short
processes:
a. FCFS
b. RR
c. Multilevel feedback queues
Problem 7
Discuss how the following pairs of scheduling criteria conflict in certain settings:
a. CPU utilization and response time
b. Average turnaround time and maximum waiting time
c. I/O device utilization and CPU utilization

Abdul Mateen September 17, 2019


Operating Systems BCS Fall 17
Problem 8
Consider a set of n tasks with known runtimes R1, R2...R(n) to be run on a uniprocessor machine.
Which of the processor scheduling algorithms will result in the maximum throughput?
Problem 9
What advantage is there in having different time-quantum sizes on different levels of a multilevel
queuing system?
Problem 10
Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound
tasks issue an I/O operation once for every millisecond of CPU computing and that each I/O operation
takes 10 milliseconds to complete. Also assume that the context-switching overhead is 0.1 MS and that
all processes are long-running tasks. Describe the CPU utilization for a round-robin scheduler when:
a. The time quantum is 1 millisecond
b. The time quantum is 10 milliseconds
Problem 11
Many scheduling algorithms are parameterized. For instance, the round-robin algorithm requires a
parameter to indicate the time quantum. The multi-level feedback (MLF) scheduling algorithm requires
parameters to define the number of queues, the scheduling algorithm for each queue, and the criteria
to move processes between queues (and perhaps others. . .). Hence, each of these algorithms
represents a set of algorithms (e.g., the set of round-robin algorithms with different quantum sizes).
Further, one set of algorithms may simulate another (e.g., round-robin with infinite quantum duration
is the same as first-come, first-served (FCFS)). For each of the following pairs of algorithms, answer the
following questions:
1. Priority scheduling and shortest job first (SJF)
a. State the parameters and behavior of priority scheduling
b. State the parameters and behavior of SJF
c. Can SJF simulate priority scheduling for all possible parameters of priority scheduling? (How or
why not: State how to set SJF scheduling parameters as a function of priority scheduling
parameters or explain why this cannot be done.)
d. Can priority scheduling simulate SJF for all possible parameters of SJF?(How or why not?)
2. Multilevel feedback queues and first come first served (FCFS)
a. State the parameters and behavior of multi-level feedback queues
b. State the parameters and behavior of FCFS
c. Can FCFS simulate multi-level feedback for all possible parameters of multi-level feedback?
d. Can multi-level feedback scheduling simulate FCFS for all possible parameters of FCFS?(How or
why not?)
3. Priority scheduling and first come first served (FCFS)
a. Can FCFS simulate priority scheduling for all possible parameters of priority scheduling? (How or
why not?)
b. Can priority scheduling simulate FCFS for all possible parameters of FCFS? (How or why not?)
4. Round-robin and shortest job first (SJF)
c. State the parameters and behavior of round robin
d. Can round robin simulate SJF for all possible parameters of SJF? (How or why not?)
e. Can SJF simulate round robin for all possible parameters of round robin? (How or why not?)
Problem 12
Write short but descriptive notes on different techniques available for evaluation of Scheduling
Algorithms. (Maximum two pages)
Abdul Mateen September 17, 2019
Operating Systems BCS Fall 17
PART-II (Practice Numerical) [50 marks]
Problem 1 Process Arrival Time Burst Time
Draw the graph and compute waiting time and P0 0 7
turnaround time for the following processes using FCFS, P1 3 9
SJF and SRTF. P2 6 5
P3 8 12
P4 10 6

P5 11 5
P6 12 3
Problem 2

Draw the graph and compute turnaround time for the


following processes using RR Scheduling algorithm. Process Arrival Time Burst Time
Consider a time slice of 4 sec. Every even number P1 0 4
process performs I/O after every 4 sec of its running life. P2 1 5
I/O takes 8 seconds. P3 4 11
P4 5 9
P5 7 6
P6 10 10

P7 12 7
P8 14 5
Problem 3
Schedule the following processes using RR and VRR. The processes P1, P2 and P3 have arrived at time
units 0, 1 and 2 respectively. The number inside the parenthesis indicates the time units for CPU and
I/O Bursts. Assume a time quantum of 4 time units.

P1 CPU Burst (6) I/O Burst (8) CPU Burst (3) I/O Burst (4) CPU Burst (5)
P2 CPU Burst (7) I/O Burst (5) CPU Burst (2)

P3 CPU Burst (5) I/O Burst (5) CPU Burst (4) I/O Burst (4) CPU Burst (3)
Problem 4



Draw the graph for the following processes using MLFB Queue Scheduling algorithm:
a. RR Time Slice (20 sec)
b. RR Time Slice (50 sec)
c. FCFS
Process Arrival Time Burst Time
P1 10 100
P2 50 120
P3 60 180
P4 65 110
P5 80 70

Abdul Mateen September 17, 2019

You might also like