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

Assignment-2 on CPU Scheduling

The document outlines an assignment for a 4th semester operating systems course, consisting of multiple problems related to process scheduling algorithms, including Gantt charts, turnaround and waiting times, and completion orders for various scheduling methods. It covers different algorithms such as FCFS, SJF, non-preemptive priority, RR, and multi-level feedback queues, along with specific scenarios involving CPU and I/O bursts. Students are required to analyze and compute the performance metrics for the given processes under these scheduling schemes.

Uploaded by

Saransh Tyagi
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)
10 views

Assignment-2 on CPU Scheduling

The document outlines an assignment for a 4th semester operating systems course, consisting of multiple problems related to process scheduling algorithms, including Gantt charts, turnaround and waiting times, and completion orders for various scheduling methods. It covers different algorithms such as FCFS, SJF, non-preemptive priority, RR, and multi-level feedback queues, along with specific scenarios involving CPU and I/O bursts. Students are required to analyze and compute the performance metrics for the given processes under these scheduling schemes.

Uploaded by

Saransh Tyagi
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/ 3

Assignment -2

Operating System, CSE-4th SEMESTER

Last Date of Submission:


1. Consider the following set of processes, with the length of the CPU burst 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 that illustrate the execution of these processes using the
following scheduling algorithms: FCFS, SJF, non-pre-emptive priority (a smaller
priority number implies a higher priority), and RR (quantum = 1).
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 algorithms in part (a) results in the minimum average waiting time
(over all processes)?

2. Consider the following set of processes, with the length of the CPU burst and arrival
time given in milliseconds.
Process Burst Time Arrival Time
P1 8 0
P2 4 0.4
P3 1 1
a) Draw four Gantt charts that illustrate the execution of these processes using the
following scheduling algorithms: FCFS, SJF, Clairvoyant SJF (the algorithm can
look into the future and wait for a shorter process that will arrive).
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 algorithms in part (a) results in the minimum average waiting time
(over all processes)?
3. The arrival time, priority, and duration of the CPU and I/O bursts for each of three
processes P1, P2 and P3 are given in the table below. Each process has a CPU burst
followed by an I/O burst followed by another CPU burst. Assume that each process
has its own I/O resource.

The multi-programmed operating system uses preemptive priority scheduling. What


are the finish times of the processes P1, P2 and P3 ?

4. Consider a set of 5 processes:


I/O Arrival CPU Time(msec) Priority
P1 0 10 5
P2 0 7 2
P3 4 5 1
P4 10 15 4
P5 20 3 3
Smaller the number, higher and priority. If the CPU scheduling used is SIF, the
average waiting time (without preemption) is?
5. Consider the 3 processes, P1, P2 and P3 shown in the table.
Process Arrival Time Time Units Required
P1 0 5
P2 1 7
P3 3 4
What is the completion order of the 3 processes under the policies FCFS and RR2
(round robin scheduling with CPU quantum of 2 time units)?
6. For the processes listed in the following table, which of the following scheduling
schemes will give the lowest average turnaround time?
(a) First Come First Serve
(b) Non-preemptive Shortest Job First
(c) Shortest Remaining Time
(d) Round Robin with Quantum value two
Process Arrival Time Time Units Required
A 0 3
B 1 6
C 4 4
D 6 2

7. Consider a system which requires 40-time units of burst time. The Multilevel
feedback queue scheduling is used and time quantum is 2 unit for the top queue and is
incremented by 5 unit at each level, then in what queue the process will terminate the
execution?
8. Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which
is composed of an infinite sequence of jobs (or instances) which arrive periodically at
intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the
inverse of its period, and the available tasks are scheduled in order of priority, with
the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an
execution time of 1,2 and 4 milliseconds, respectively. Given that all tasks initially
arrive at the beginning of the 1st millisecond and task preemptions are allowed, when
does the first instance of T3 completes its execution in milliseconds?
9. Three processes A, B and C each execute a loop of 100 iterations. In each iteration of
the loop, a process performs a single computation that requires tc CPU milliseconds
and then initiates a single I/O operation that lasts for tio milliseconds. It is assumed
that the computer where the processes execute has sufficient number of I/O devices to
each process. Also, the scheduling overhead of the OS is negligible. The processes
have the following characteristics:

Process id tc (ms) tio (ms)


A 100 500
B 350 500
C 200 500

The processes A, B and C are started at times 0, 5 and 10 milliseconds respectively. In


a pure time sharing system (Round-Robin scheduling) that uses a time slice of 50
milliseconds. What is the time in milliseconds at which process C would complete its
first I/O operation?

You might also like