Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Assignment 2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

FAZAIA BILQUIS COLLEGE OF EDUCATION FOR WOMEN

PAF Nur Khan, Rawalpindi

Subject: Operating System Teacher Name: Ms.Shumaila


Class: BSCS Semester: 5th
Due Date : 2-jan-2023 Assignment :2

Question #1
a) There are many possible CPU-scheduling algorithms. How could we select one particular
algorithm for a particular system? Discuss various evaluation methods.
b) Suppose that processes P1, P2,. .., P5 arrive for execution at the times indicated in
Table .Each process will run for the amount of time listed and will be assigned a priority ranging
from 0 (highest) to 10 (lowest). No more processes will arrive until the last process
completes.
In answering the questions, base all decisions on the information you have at the time the
decision must be made

Question #2
Draw four Gantt charts that illustrate the execution of these processes using the following
scheduling algorithms and compare your results.
a) FCFS
b) Preemptive and Non-preemptive SJF
Preemptive priority (SJF if priority is equal)

e)
RR (quantum=2).
c) Preemptive priority (SJF if priority is equal)
d) RR (quantum=2).
In addition:
a) What is the turnaround time of each process for each of these four scheduling
algorithms?
b) What is the waiting time of each process for each of these four scheduling
algorithms?
In addition:
a) What is the turnaround time of each process for each of these four scheduling algorithms?
b) What is the waiting time of each process for each of these four scheduling algorithms?
Which of the algorithms results in the minimum average waiting time (over all
processes)?
c) Which of the algorithms results in the minimum average waiting time (over all
Processes)?

Question #3
A scheduling algorithm determines the order in which an operating system will execute
processes. How quickly a process will finish depends on the size of the job and the scheduling
algorithm used.

Some jobs are sent to be processed. The times shown are in minutes.

Arrival time Job Time to complete


0:00 A 5:00
2:30 B 2:00
3:10 C 1:00

In which order will the jobs complete under each of the following scheduling algorithms?

Calculate average waiting time using FCFS,SJF and SRTF.

Round robin. Assume that:

 a time slice is 1 minute


 if a job is not finished when the time slice completes, it joins the rear of the queue for
another slice of the action!

You might also like