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

Numercals on non preemptive CPU Scheduling Algorithm

The document outlines multiple examples of scheduling algorithms including FCFS, SJF, priority scheduling, and Round Robin (RR) for various sets of processes with specified burst times. Each example requires the creation of Gantt charts and the calculation of average waiting times. The document serves as a guide for understanding how different scheduling policies impact process execution and waiting times.

Uploaded by

sultany560
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Numercals on non preemptive CPU Scheduling Algorithm

The document outlines multiple examples of scheduling algorithms including FCFS, SJF, priority scheduling, and Round Robin (RR) for various sets of processes with specified burst times. Each example requires the creation of Gantt charts and the calculation of average waiting times. The document serves as a guide for understanding how different scheduling policies impact process execution and waiting times.

Uploaded by

sultany560
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Example 1: Draw the Gantt chart for the FCFS policy, considering the following set of

processes that arrive at time 0, with the length of CPU burst time given in m-sec. Also, calculate
the average waiting time.

Process Burst Time


P1 13
P2 08
P3 83

Example 2: Draw the Gantt chart, using SJF scheduling for the given data. Also calculate the
average waiting time.

Process Burst Time


P1 10
P2 03
P3 19
P4 82

Example 3: Schedule the given processes using priority scheduling when all the processes at the
time zero, in order P1, P2, ---- P5, with the length of CPU burst time given in milliseconds:

Process Burst Time Priority


P1 11 03
P2 02 01
P3 03 04
P4 02 05
P5 06 02

Example 4: Consider the following set of processes that arrives at time 0 ms.

Process Burst Time


P1 20
P2 03
P3 04
If we use the time quantum of 4 ms then calculate the average waiting time using R-R
scheduling.

Page | 1
Example 5: Consider the following set of processes that arrive at time zero, with the length of
CPU burst time given in milliseconds:

Process Burst Time


P1 24
P2 03
P3 03
If we use the time quantum of 4 ms, schedule the process using R-R scheduling algorithm.

Example 6: For the given five processes arriving at time zero, in the order given with the length
of CPU burst time in milliseconds:

Process Burst Time


P1 10
P2 29
P3 03
P4 07
P5 12
Consider the FCFS, SJF and RR (quantum = 10 milliseconds) scheduling algorithms for this set
of processes. Which algorithm would give the minimum average waiting time?

Example 7: Consider the following four processes with the length of the CPU burst time in
millisecond:

Process Arrival Time Burst Time


P1 0 08
P2 01 04
P3 02 09
P4 03 05
Find out which of the following algorithms gives the least average waiting time for the above
worked:

i. FCFS
ii. RR (Slice = 4 ms)
iii. SRTF

Example 8: Consider the following set of processes, with the length of the burst time given in
milliseconds:

Page | 2
Process Burst Time Priority
P1 10 03
P2 01 01
P3 02 03
P4 01 04
P5 05 02
The processes are assumed to have arrived in order P1, P2, P3, P4, and P5 all at time 0.

a) Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a
non pre-emptive priority (a smaller priority number implies a higher priority), and RR
(Quantum = 1) scheduling.
b) What is the turnaround time of each process for each of the scheduling algorithm in part
a?
c) What is the waiting time of each process for each of the scheduling algorithm in part a?
d) Which of the schedules in part a results in the minimal average waiting time (overall
processes)?

Example 9: Consider the following set of processes, assumed to have arrived at time 0, in the
order P1, P2, P3, ----, P5, with the length of CPU bust time given in milliseconds:

Process Burst Time Priority


P1 10 03
P2 01 01
P3 02 04
P4 01 05
P5 05 02
Using priority scheduling, calculate the average waiting time.

Page | 3

You might also like