Working With CPU Scheduling Algorithms
Working With CPU Scheduling Algorithms
1. Given the list of processes, their CPU burst times and arrival time, display/print the
Gantt chart for FCFS. Compute the waiting time and turnaround time for each
processor. Print the table of information which contains process name, execution time,
waiting time and turnaround time. Finally print the average waiting time and average
turnaround time.
Process Burst Time Arrival Time
P1 12 0
P2 25 2
P3 13 1
P4 7 0
P5 11 5
2. Write a C program to implement Shortest Job First CPU scheduling algorithm where
Processes do not arrive at the same time. Display the following results in a table format.
i) Arrival time and Burst time of every process.
ii) Waiting time and turnaround time of every process.
iii) Average waiting time and turnaround time.
iv) Total idle time of the processor.
Process Burst Time
P1 12
P2 22
P3 14
P4 7
P5 10
3. Consider the following 4 jobs P1, P2, P3, and P4. Their arrival time and burst time
are given below in the table.
Job Arrival Time Burst Time
1 0 7
2 1 4
3 3 9
4 4 5
Compute the completion time, Turn Around Time, Waiting Time and Response
Time using Shortest Remaining Time First (SRTF) Scheduling Algorithm