Search⌘ K
AI Features

Simulator

Understand CPU scheduling by experimenting with a simulator that implements FIFO, SJF, and Round Robin algorithms. Learn to compute response time, turnaround time, and wait time for different job lists and verify your calculations using provided solutions. This lesson helps deepen your grasp of scheduling metrics and policies in operating systems.

We'll cover the following...

This program, scheduler.py, allows you to see how different schedulers perform under scheduling metrics such as response time, turnaround time, and total wait time. Three schedulers are “implemented”: FIFO, SJF, and RR.

There are two steps to running the program.

First, run without the -c flag: this shows you what problem to solve without revealing the answers. For example, if you want to compute the response, turnaround, and wait for three jobs using the FIFO policy, run this in the terminal provided below:

./scheduler.py -p FIFO -j 3 -s 100

If that doesn’t work, try this:

python ./scheduler.py -p FIFO -j 3 -s 100

This specifies the FIFO policy with three jobs, and, importantly, a specific random seed of 100. If you want to see the solution for this exact problem, you have to specify this exact same random seed again. ...