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

OS Assignment 1

The document is an assignment for second-year Computer Science and Engineering students focusing on operating system scheduling algorithms. It includes multiple questions requiring the calculation of mean process turnaround time, mean process waiting time, and other performance metrics for various scheduling algorithms such as FCFS, SJF, and Round Robin. Students are tasked with analyzing batch jobs with different priorities and execution times, drawing Gantt charts, and commenting on the efficiency of the scheduling methods used.

Uploaded by

ash0014as
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)
4 views

OS Assignment 1

The document is an assignment for second-year Computer Science and Engineering students focusing on operating system scheduling algorithms. It includes multiple questions requiring the calculation of mean process turnaround time, mean process waiting time, and other performance metrics for various scheduling algorithms such as FCFS, SJF, and Round Robin. Students are tasked with analyzing batch jobs with different priorities and execution times, drawing Gantt charts, and commenting on the efficiency of the scheduling methods used.

Uploaded by

ash0014as
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/ 2

Panipat Institute of Engineering and Technology, Samalkha, Panipat

Computer Science and Engineering


Operating System
Assignment-1
(CSE-2nd Year, Sec-A)

Q1. Eight batch job A through H, arrive at a computer center at same time. They have estimated running time
(Processing time) of 10, 6, 2, 4, 8, 4, 3 and 6 minutes. Their (externally determined) Priority are 3, 5, 2, 1, 4, 2,
3 and 1 respectively, with 5 being the highest priority. For each of the following scheduling algorithms,
determine the mean process turnaround time, mean process waiting time. Ignore the process of switching
overhead.
A. First come first served (FCFS) algorithm
B. Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
C. Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
D. Non-preemptive priority scheduling algorithm
E. Preemptive priority scheduling algorithm
F. Round Robin (Time Quantum=2)
For F assume that the system is multi-programmed and that each job gets its fair share of CPU. For A and B
assume that only one job at a time run, until it finishes.

Q2. Consider the set of processes given in the table and the following scheduling algorithm:
1) First come first served (FCFS) algorithm
2) Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
3) Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
4) Non-preemptive priority scheduling algorithm
5) Preemptive priority scheduling algorithm
6) Round Robin (Time Quantum=3)

Process Id Priority Execution Time Arrival Time


A 3 7 3
B 3 3 5
C 2 5 4
D 4 2 8
E 2 1 14
F 4 1 12

Assuming 0 to be the highest priority. Draw the Gantt chart and find the average waiting time, average
turnaround time, CPU utilization, throughput, response time for the algorithms. Comment on your result which
one is better and why?

Q3. Consider the set of processes given in the table and the following scheduling algorithm:
A. First come first served (FCFS) algorithm
B. Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
C. Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
D. Non-preemptive priority scheduling algorithm
E. Preemptive priority scheduling algorithm
F. Round Robin (Time Quantum=2)

Process Id Arrival Time CPU Burst Time Priority


P0 00.00 7 3
P1 11.50 5 1
P2 12.20 3 3
P3 16.10 2 4
P4 12.20 3 2
P5 14.30 4 1
P6 09.00 1 2
Draw the Gantt chart and find the average waiting time, average turnaround time, CPU utilization,
throughput, response time for the algorithms. Comment on your result which one is better and why?

Q4. Eight batch job A through H, arrive at a computer center at 01:00, 01:10, 02:10, 01:30, 02:30, 01:50,
02:10 and 02:30. They have an estimated running time (Processing time) of 5, 10, 2, 4, 8, 4, 6 and 2 minutes.
Their (externally determined) Priority are 3, 5, 2, 1, 4, 2, 3 and 1 respectively, with 5 being the highest priority.
For each of the following scheduling algorithms, determine the mean process turnaround time, mean process
waiting time, CPU utilization and Throughput. Ignore the process of switching overhead.
A. First come first served (FCFS) algorithm
B. Shortest Job First (SJF) or Shortest-next-CPU-burst algorithm or non-preemptive SJF
C. Shortest Remaining Job First (SRJF) or Shortest Remaining Time First (SRTF) or Preemptive SJF
D. Non-preemptive priority scheduling algorithm
E. Preemptive priority scheduling algorithm
F. Round Robin (Time Quantum=2)
For F assume that the system is multi-programmed and that each job gets its fair share of CPU. For A and B
assume that only one job at a time run, until it finishes.

You might also like