-
Notifications
You must be signed in to change notification settings - Fork 0
Scheduling Methodologies
The first scheduling methodology that we have chosen to implement is FIFO which stands for First-in, First-out. This scheduling methodology gives the higher priority to the process that shows up in the system first, if all of the processes show up at the same time then the first one can be picked at random. The process with the highest priority is then placed on the ready queue for the CPU to execute. Like SJF, FIFO is also non-preemptive which means that once the process is placed on the ready queue it runs until it is completed or put into waiting. An advantage that FIFO would have over SJF is that it is easier to implement and you can determine the order that processes will run by simply putting the process you want to run first into the system first.
Some benefits of using FIFO are:
- Simplest scheduling methodology to understand
- You can choose which processes execute first as the process that enters first is the one to execute first
Some drawbacks of using FIFO:
- Since the first process to execute is the first one to come into the system, there is no system to schedule processes with shorter service times
- Processes towards the end of the ready queue could be waiting a long time, possibly suffering starvation
- The average waiting time will be higher
Justification
We chose to implement FIFO as we wanted to see what a baseline would be for comparing our different scheduling methodologies. FIFO is definitely one of the more simplistic methodologies and we think that it would be interesting to see just how much things like the total turnaround time will change and in what situations each methodology might have the advantage over the other
The second scheduling methodology we are going to implement is Shortest Job First. This scheduling works by assigning higher priority to processes with lower total service time. This means that the process in the ready queue with the lowest total service time is the one with the highest priority and is the process that will be put onto the CPU to execute. This scheduling algorithm is non-preemptive, meaning that the process that is executing on the CPU will continue running until it is completed or enters a waiting state. The process won't be interrupted and removed from the CPU for any other process, even if a process with a lower total service time enters the ready queue. Additionally, if two processes in the ready queue have the same service time their priorities will be assigned either randomly or will be assigned chronologically by a certain metric such as process ID.
Some benefits of using SJF are:
- Shortest service time processes will have a higher priority, so the process with the lowest service time will execute first to completion.
- Will result in the lowest possible average waiting time for the set of processes if all processes are in the system prior to execution.
Some drawbacks of using SJF are
- Non-Preemptive. If shorter service time processes enter the system during execution they will have to wait for the currently running process to finish execution
- Possible starvation for the longer service time processes waiting towards the end of the ready queue
Justification
We chose to implement SJF because we want to compare it to FIFO to see how much time time difference when scheduling the process in the order they arrive versus choosing the process that has the shortest service time. We anticipate for SJF to have a much quicker total turnaround time but it will be interesting to see the exact amount of time that is saved.