week 8 scheduling Flashcards
to learn
what is scheduling problem
Have processes competing for resources (eg CPU, disk other
devices)
Important OS function: define a schedule to manage access of
processes to these resources
Typically done by having queues of processes waiting for a
specific resource and selecting a process in the queue
how is scheduling done?
Typically done by having queues of processes waiting for a
specific resource and selecting a process in the queue
what are the type of scheduling queues:
Job queue
Ready queue
Device queues
what is a job queue is scheduling:
- set of all processes in the system
what is a ready queue is scheduling:
- set of all processes residing in main memory,
ready and waiting to execute
what is a device queue in scheduling:
- set of processes waiting for an I/O device
Processes migrate among the various queues
can processes move to different queues
yes! Processes migrate among the various queues
what is a problem with cpu scheduling
Which process ready to execute commands gets the
CPU?
key function of a programming system.
Prerequisites for successful scheduling: (2 things)
1.) CPU-I/O-Burst Cycle
Experience shows: I/O occurs after fixed amount of time in ≥ 90%
⇒ appropriate time for re-scheduling
2.) Preemptive Scheduling: Processes can be forced to relinquish
processor
what is the scheduling criteria:
CPU utilisation
Throughput: Number of processes completed within a given
time
Turnaround time: Time it takes for each process to be
executed
Waiting time: Amount of time spent in the ready-queue
Response time: time between submission of request and
production of first response
what is throughput
Number of processes completed within a given
time
what is turnaround time
Time it takes for each process to be
executed
what is waiting time
Amount of time spent in the ready-queue
what is response time
time between submission of request and production of first response
what are the two categories in processes
I/O-bound process
CPU-bound process
I/O bound process
- spends more time doing I/O than computations, many short CPU bursts
cpu bound process
spends more time doing computations;
few very long CPU bursts
describe first come first serve algorithm (FCFS)
Jobs are put in a queue, and served according to arrival time
Easy to implement but CPU-intensive processes can cause long
waiting time.
FCFS with preemption is called Round-Robin
standard method in time sharing systems
Problem: get the time quantum (time before preemption) right.
- too short: too many context switches
- too long: Process can monopolise CPU
benefit of fcfs
easy to implement
what is round robin
FCFS with preemption
standard method in time sharing systems
what is a problem with round robin
Problem: get the time quantum (time before preemption) right.
- too short: too many context switches
- too long: Process can monopolise CPU
what happens if time before preemption in round robin is too short:
too short: too many context switches
what happens if time before preemption in round robin is too long:
- too long: Process can monopolise CPU
describe shortest job first
Next job is one with shortest CPU-burst time (shortest CPU-time
before next I/O-operation)
Not implementable, but this is algorithm with the smallest average
waiting time
⇒ Strategy against which to measure other ones
Approximation: Can we predict the burst-time?
Only hope is extrapolation from previous behaviour
done by weighting recent times more than older ones.
τn+1 = αtn + (1 − α)τn