You are on page 1of 3

OPERATING SYSTEMS CS 320

Due Date: Tuesday, November 29, 2011

PART-I (Check/Build your Concepts) 50 mks


Problem 1
Most round-robin schedulers use a fixed size quantum. Give an argument in favor of and against a small quantum.

Problem 2
As a system administrator you have noticed that usage peaks between 10:00AM to 5:00PM and between 7:00PM to 10:00PM. The company's CEO decided to call on you to design a system where during these peak hours there will be three levels of users. Users in level 1 are to enjoy better response time than users in level 2, who in turn will enjoy better response time than users in level 3. You are to design such a system so that all users will still get some progress, but with the indicated preferences in place. 1. Will a fixed priority scheme with pre-emption and 3 fixed priorities work? Why, or why not? 2. Will a UNIX-style multi-feedback queue work? Why, or why not? 3. If none of the above works, could you design a scheduling scheme that meets the requirements?

Problem 3
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) a) State the parameters and behavior of round robin b) Can round robin simulate SJF for all possible parameters of SJF? (How or why not?) c) Can SJF simulate round robin for all possible parameters of round robin? (How or why not?)

Problem 4
Write short but descriptive notes on different techniques available for evaluation of Scheduling Algorithms. (Maximum two pages)

CMP 320 Arif Butt

Page 1

PART-II (Practice Numericals)


50 mks
Question 1
Draw the Gantt chart and compute turnaround time for the following processes using RR Scheduling algorithm. Consider a time slice of 2 sec

Process P1 P2 P3 P4 P5

Arrival Time 0 2 3 5 9

Burst Time 3 8 4 2 5

Question 2
Draw the Gantt chart and compute turnaround time for the following processes using RR Scheduling algorithm. Consider a time slice of 3 sec. Every even no process performs I/O after every 2 sec of its life. I/O takes 5 sec.

Process P1 P2 P3 P4 P5

Arrival Time 0 2 3 5 7

Burst Time 7 4 3 5 6

Question 3
Draw the graph and compute turnaround time for the following processes using RR Scheduling algorithm. Consider a time slice of 3 sec. Every odd no process performs I/O after every 2 sec of its life. I/O takes 5 sec.

Process P1 P2 P3 P4 P5

Arrival Time 0 2 3 5 7

Burst Time 7 4 3 5 6

Question 4
Draw the graph and compute turnaround time for the following processes using VRR Scheduling algorithm. Consider a time slice of 3 sec. Every odd no process performs I/O after every 2 sec of its life. I/O takes 5 sec.

Process P1 P2 P3 P4 P5

Arrival Time 0 2 3 5 7

Burst Time 7 4 3 5 6

Question 5
Draw the graph and compute turnaround time for the following processes using VRR Scheduling algorithm. Consider a time slice of 3 sec. Every even no process performs I/O after every 2 sec of its life. I/O takes 10 sec.

Process P1 P2 P3 P4 P5

Arrival Time 1 3 4 5 15

Burst Time 3 10 5 9 2

Question 6
Draw the graph for the following processes using MLFB Queue Scheduling algorithm.

Q1 - RR - 30 sec Q2 - RR - 60 sec Q3 - FCFS

CMP 320 Arif Butt

Page 2

Process P1 P2 P3 P4 P5

Arrival Time 10 50 60 65 80

Burst Time 100 120 180 110 70

Question 7
Draw the graph and compute waiting time and turnaround time for the following processes using FCFS, SJF and SRTF.

Process P0 P1 P2 P3 P4 P5 P6

Arrival Time 1 4 6 8 10 11 12

Burst Time 7 9 3 14 5 4 2

Question 8
Draw the graph and compute turnaround time for the following processes using RR & VRR Scheduling algorithm. Consider a time slice of 4 sec. Every even number process performs I/O after every 3 sec of its running life. I/O takes 10 seconds.

Process P1 P2 P3 P4 P5 P6 P7 P8

Arrival Time 0 1 4 5 7 10 12 14

Burst Time 4 3 11 9 6 10 7 5

Submission Instructions:
Solutions to Part I must be your own ideas, and Solutions to Part II must be your hard work. NO ONE should get help from Teaching Assistants. DONOT let any one copy your assignment. In case of a copy both students will be awarded a ZERO may be some negative marks as well. You have to submit your assignment in HAND written form on plain A4 Sheets. Attach a cover sheet showing the assignment title, course and your personal information. Simply staple the papers of your assignments and hand over to CR of your class. Respective CRs should submit all the assignments to me in my office before 2:00 pm on Tuesday, November 29, 2011. In case of absence of CR, who so ever is having the smallest roll no in the class should perform this responsibility. You should expect a QUIZ from scheduling algorithms in Mondays class on November 28, 2011. Late submissions will NOT be accepted. So start doing the problems from today so that you can submit your assignment in time.

For cheating policy please refer to Lecture 01, Slide #7

TIME IS JUST LIKE MONEY. THE LESS WE HAVE IT; THE MORE WISELY WE SPEND IT. Manage your time and Good Luck

Arif November 21, 2011


CMP 320 Arif Butt Page 3

You might also like