We previously covered an example of scheduling queue in 2 Process Manager, as shown below. However, we only covered FIFO during that time.



Introduction

In particular, there are various algorithms which can be used to schedule the jobs:

  1. First In First Out (FIFO): Jobs are executed on a first come, first serve basis irrespective of burst time or priority.
  2. Last In First Out (LIFO): Jobs are executed on a last come, first serve basis irrespective of burst time or priority.
  3. Shortest Job First (SJB): Process with the minimum burst time at an instance executes first.
  4. Priority Based Scheduling (P): Each process is assigned a priority and the process with the highest priority executes first followed by the ones lower in priority.

We will implement these four different scheduling mechanisms and compare the average waiting time. Consider the following processes with the given arrival time and burst time:

Process Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4

<aside> <img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> The professor demonstrates the following problem just using table values. For this example, I will demonstrate it using a timeline to provide another perspective on the solution.

</aside>

A few things to note:

First In First Out