0% found this document useful (0 votes)
19 views2 pages

CPU Scheduling

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)
19 views2 pages

CPU Scheduling

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

 Given n processes with their burst times, your task is to find average waiting time and

average turnaround time using FCFS CPU scheduling algorithm.

1)
Process Arrival Time Duration (Burst Time)
1. P1 0 24
2. P2 0 3
3. P3 0 4

2)
Process Arrival Time Duration (Burst Time)
1. P1 0 12
2. P2 1 6
3. P3 4 9
3)
Process Arrival Time Duration (Burst Time)
1. P1 0 5
2. P2 1 3
3. P3 2 8
4. P4 3 6

 Implement the SJF CPU Scheduling algorithm in C considering following table:

1)

Process Arrival Time Duration (Burst Time)


1. P1 2 6
2. P2 5 2
3. P3 1 8
4. P4 0 3
5. P5 4 4

2)
Process Arrival Time Duration (Burst Time)
1. P1 0 8
2. P2 1 4
3. P3 2 9
4. P4 3 5
3)
Process Arrival Time Duration (Burst Time)
1. P1 0 6
2. P2 0 8
3. P3 0 7
4. P4 0 3

 Simulate Round Robin CPU Scheduling algorithm using below table:

1)
o Time quantum – 2

Process Arrival Time Duration (Burst Time)


1. P1 0 5
2. P2 0 4
3. P3 0 2
4. P4 0 1

2)
o Time quantum – 6

Process Arrival Time Duration (Burst Time)


1. P1 0 8
2. P2 1 5
3. P3 2 10
4. P4 3 11
3)
o Time quantum – 4

Process Arrival Time Duration (Burst Time)


1. P1 0 24
2. P2 0 3
3. P3 0 3
4)
o Time quantum – 20

Process Arrival Time Duration (Burst Time)


1. P1 0 53
2. P2 0 17
3. P3 0 68

You might also like