1. In preemptive scheduling, tasks may be interrupted in order to run a different task. Nonpreemptive scheduling requires tasks to yield or complete in order to start running the next task.
  2. Suppose the following information:
ProcessArrival TimeBurst Time
P108
P20.44
P311

Using FCFS scheduling:

ProcessArrival TimeBurst TimeWait Time
P1080
P20.448
P31112
Avg. wait time = 6.6

Using SJF scheduling:

ProcessArrival TimeBurst TimeWait Time
P1080
P3118
P20.449
Avg. wait time = 5.6

Using ‘future-knowledge’ scheduling:

ProcessArrival TimeBurst TimeWait Time
P3111
P20.442
P1086
Avg. wait time = 3
  1. If for example, you have queues for different types of tasks, such as interrupts being handled by the OS or a background task doing calculations, you’d want probably want a longer time quantum for tasks doing calculations as preempting this task regularly would probably make it run longer overall.
  2. .
  3. I/O bound tasks just need to read / write a request for some data and can then yield hence using little processing time.
  4. I/O bound tasks require the processor to wait for some external device, while CPU-bound tasks spend executing code on the processor. It is favourable to allow I/O tasks to run first so they can continue to wait in the background while CPU-tasks execute.
  5. .
  6. .
  7. Shortest job first
  8. a. The process added twice will have the opportunity to run twice as long as any other process in the queue every time the whole queue is processed. b. It provides a simple ‘dumb’ way to do priority scheduling. It is a relatively easy algorithm to implement. It requires us to preempt processes which is more complicated than not. It does not allow us to prioritise I/O bound tasks in order to allow them to fetch in the background and hence complete earlier.
  9. .
  10. .
  11. .
  12. .
  13. .