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

Problems on scheduling algorithms

The document outlines practice problems for various CPU scheduling algorithms including FCFS, Non-Preemptive and Preemptive Shortest Job First, Priority Scheduling, and Round Robin. Each section provides specific problems with details on process IDs, arrival times, and burst times for students to calculate waiting and turnaround times. The document is intended for students in the Computer Science and Engineering department at Cambridge Institute of Technology.

Uploaded by

Varalatchoumy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Problems on scheduling algorithms

The document outlines practice problems for various CPU scheduling algorithms including FCFS, Non-Preemptive and Preemptive Shortest Job First, Priority Scheduling, and Round Robin. Each section provides specific problems with details on process IDs, arrival times, and burst times for students to calculate waiting and turnaround times. The document is intended for students in the Computer Science and Engineering department at Cambridge Institute of Technology.

Uploaded by

Varalatchoumy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

CAMBRIDGE INSTITUTE OF TECHNOLOGY

K.R. PURAM, BENGALURU-560036

Department of Computer Science and Engineering

Operating system (18CS43) IV sem A & C

For all scheduling algorithms calculate the waiting time for each
process, turnaround time for each process and average waiting
time

PRACTICE PROBLEMS BASED ON FCFS


SCHEDULING

Problem-01:

Consider the set of 5 processes whose arrival time and burst time are given
below-

Arrival Burst
Process Id
time time

P1 3 4

P2 5 3

P3 0 2

P4 5 1

P5 4 3
Problem-02:

Consider the set of 3 processes whose arrival time and burst time are given
below-

Process Id Arrival time Burst time

P1 0 2

P2 3 1

P3 5 6

Problem-03:

Consider the set of 6 processes whose arrival time and burst time are given
below-

Process Arrival Burst


Id time time

P1 0 3

P2 1 2

P3 2 1

P4 3 4

P5 4 5

P6 5 2
Practice Problem based on Non-Preemptive Shortest Job
First CPU Scheduling Algorithm:

1.
Process Burst Time Arrival Time

P1 6 ms 2 ms

P2 2 ms 5 ms

P3 8 ms 1 ms

P4 3 ms 0 ms

P5 4 ms 4 ms

2.
Practice Problem based on Preemptive Shortest Job First
CPU Scheduling Algorithm:

1.
Process Burst Time Arrival Time

P1 6 ms 2 ms

P2 2 ms 5 ms

P3 8 ms 1 ms

P4 3 ms 0 ms

P5 4 ms 4 ms

2.

Process Id Arrival time Burst time

P1 3 1

P2 1 4

P3 4 2

P4 0 6

P5 2 3
3.

Process Id Arrival time Burst time

P1 3 1

P2 1 4

P3 4 2

P4 0 6

P5 2 3

4.

Process Id Arrival time Burst time

P1 0 7

P2 1 5

P3 2 3

P4 3 1

P5 4 2

P6 5 1
5.

Process Id Arrival time Burst time

P1 0 9

P2 1 4

P3 2 9

6.

Process Id Arrival time Burst time

P1 0 20

P2 15 25

P3 30 10

P4 45 15
Practice Problem based on Priority Scheduling Algorithm:
1.

Process Id Arrival time Burst time Priority

P1 0 4 2

P2 1 3 3

P3 2 1 4

P4 3 5 5

P5 4 2 5

2.

Process Id Arrival time Burst time Priority

P1 0 4 2

P2 1 3 3

P3 2 1 4

P4 3 5 5

P5 4 2 5
3.
Process Priority Burst time Arrival time
P1 1 4 0
P2 2 3 0
P3 1 7 6
P4 3 4 11
P5 2 2 12

4.
Process Priority Burst Time Arrival Time
P1 1 4 0
P2 2 3 0
P3 1 7 6
P4 3 4 11
P5 2 2 12

Practice Problem based on Round Robin Algorithm:


1.
Process Id Arrival time Burst time

P1 0 5

P2 1 3

P3 2 1

P4 3 2

P5 4 3

Time quantum = 2units


2.
Process Id Arrival time Burst time

P1 0 4

P2 1 5

P3 2 2

P4 3 1

P5 4 6

P6 6 3

Time quantum = 2

3.
Process Id Arrival time Burst time

P1 5 5

P2 4 6

P3 3 7

P4 1 9

P5 2 2

P6 6 3

Time quantum = 3
4.
Four jobs to be executed on a single processor system arrive at time 0 in the order
A, B, C, D. Their burst CPU time requirements are 4, 1, 8, 1time units
respectively. Apply Round Robin scheduling for time quantum of 1 unit

5.
Process Burst Time Arrival Time

P1 5 ms 0 ms

P2 4 ms 1 ms

P3 2 ms 2 ms

P4 1 ms 4 ms

Time quantum = 2

6.

Process ID Arrival Time Burst Time

1 0 5

2 1 6

3 2 3

4 3 1

5 4 5

6 6 4
Time quantum = 4 units
Prescribed textbook problems

- Dr. Varalatchoumy M
Associate Professor, CSE, CITech

You might also like