Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Operating systems Lab – CPU scheduling

Q 1. Write a C program to simulate FCFS (First come First Serve) based CPU scheduling to find
turnaround time and waiting time.
Q 2. Write a C program to simulate SJF (Shortest Job First) based CPU scheduling to find turnaround
time and waiting time.
Q 3. Say that the system is running 3 jobs, A, B, and C, and that all of them are CPU-intensive (i.e.,
each one does one infinitely long CPU burst). The system begins with A on the CPU at the beginning
its time quantum while B and C are in the Ready Queue, in that order. Write a C program to simulate
such CPU scheduling with the scheduler time quantum is equal to 4 ms to find turnaround time and
waiting time for all three processes A, B, and C.
Q 4. Write a C program to simulate Priority based CPU scheduling to find turnaround time and waiting
time.

You might also like