Scheduling: round robin, first come first served, multi-level feedback queues, shortest job first and shortest remaining time Flashcards
Explain the purpose of scheduling
- Makes the most efficient use of the processor/resources
- Be fair to all users/applicants
- Provide a reasonable response time
- Prevent processes from failing to run/process starvation/deadlock
What is meant by a pre-emptive scheduling algorithm?
Jobs are actively made to start and stop by the
operating system
- Multilevel Feedback Queues, Shortest Remaining Time, Round Robin
What is meant by a non pre-emptive scheduling algorithm?
Once a job is started, it is left alone until it is completed
- First Come First Served, Shortest Job First
State 5 different scheduling algorithms
- Round robin
- First come first served
- Shortest job first
- Shortest remaining time
- Multilevel feedback queues
What is round robin?
- Each job is given a section of processor time - known as a time slice (allowed to execute)
- Once each job in the queue has used its first time slice, the operating system again grants each job an equal slice of processor time
- This continues until a job has been completed, at which point it is removed from the queue
Advantages of round robin?
- Every process gets an equal share of the CPU
- RR is cyclic in nature, so there is no starvation
Disadvantages of round robin?
- Longer jobs will take a much longer time for completion due to their
execution being inefficiently split up into multiple cycles - Does not take into account job priority
What is first come first served?
Jobs are processed in chronological order by which they entered the queue
Advantages of first come first served?
- Simple and easy to understand
- Straightforward to implement
Disadvantages of first come first served?
- FCFS again does not allocate processor time based on priority
- The process with less execution time suffer i.e. waiting time is often quite long
What is multilevel feedback queues?
This makes use of multiple queues, each which is ordered based on a different priority
Advantages of multilevel feedback queues?
- It is more flexible
- It prevents starvation by moving a process that waits too long from the lower priority queue to the higher priority queue
Disadvantages of multilevel feedback queues?
- Difficult to implement due to deciding which job to prioritise based on a combination of priorities
- Most complex algorithm
What is shortest job first?
The queue storing jobs to be processed is ordered according to the time
required for completion, with the longest jobs being serviced at the end
Advantages of shortest job first?
- It is suitable for the jobs running in batches, where run times are already known
- SJF is better than the First come first serve (FCFS) algorithm as it reduces the average waiting time