mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 14:54:05 -06:00
vault backup: 2022-10-30 14:10:53
This commit is contained in:
parent
c8bc1f4697
commit
9fde17e5bb
@ -73,4 +73,58 @@ choose the job in the queue with the shortest burst time.
|
|||||||

|

|
||||||
|
|
||||||
pro
|
pro
|
||||||
- prova
|
- provably optimal average waiting time
|
||||||
|
|
||||||
|
con
|
||||||
|
- never know in advance what the length of next cpu burst will be
|
||||||
|
- possibility of long processes never being executed
|
||||||
|
- starvation of process
|
||||||
|
- not "fair"
|
||||||
|
|
||||||
|
### predicting next burst time
|
||||||
|
machine learning sorta - burst length predicted from previous CPU bursts using exponential average equation
|
||||||
|

|
||||||
|
|
||||||
|
preemption example
|
||||||
|
- p1 is executing
|
||||||
|
- p2 arrived with burst time shorter that remainging bust time of P1
|
||||||
|
- non preemptive - P1 finishes
|
||||||
|
- preemptive - P2 takes CPU
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Priority scheduling
|
||||||
|
- each process allocated a priotit when it arrives
|
||||||
|
- cpu is allocated to the process with the highest priority
|
||||||
|
|
||||||
|
low number is a higher priority
|
||||||
|
|
||||||
|
- non preemptive - run processes until finished
|
||||||
|
- preemptive - higher priority process should take over CPU when they arrive
|
||||||
|
|
||||||
|
SJF is a type of priority scheduling where the priority is based on the estimated next cpu burst
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Starvation and aging
|
||||||
|
starvation occurs when a proces waits indefinitely to be allocated the CPU
|
||||||
|
|
||||||
|
aging - as a process waits its priority increases
|
||||||
|
|
||||||
|
## Round Robin
|
||||||
|
commonly used today
|
||||||
|
|
||||||
|
designed for time sharing systems
|
||||||
|
- small unit of time (time quantum) if defined
|
||||||
|
- ready queue is treated as a circular list
|
||||||
|
- cpu schedular goes round the ready queue, allocating the CPU to each process for a time interval up to 1 time quantum
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
choosing time quantum
|
||||||
|
- if infinitely large - we have FCFS
|
||||||
|
- if very small - we have processor sharing - lots of overhead for switching
|
||||||
|
|
||||||
|

|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user