Osc 7
Osc 7
1. Fairness
- to make sure all processes get a fair share of the CPU time
- to avoid starvation
2. Efficiency
- to maximize CPU utilization and keep the CPU busy close to 100% of the time
3. Response time
- to provide consistent response time
- to minimize response time
4. Turnaround time
- to minimize time between submission and job completion
5. Throughput
- to maximize the number of jobs completed within a given time period
Two types of CPU Scheduling
Preemptive Scheduling
• Allows for processes running to be temporarily suspended
• Processes releases CPU upon receiving a command from the operating system
Non-Preemptive Scheduling
• Processes releases the CPU only after completion
4. Priority
• Priority is associated with each process
• The CPU is allocated to a process with the highest priority
• Equal priority processes are scheduled using FIFO
• Priority can be high or low; however, 0 can mean high priority
• Can be preemptive or non-preemptive
• A problem with priority algorithm is starvation
• Aging is a technique used to gradually increase the priority of a
process
TT =
Tw+TB
Algorithm 1 - Round Robin
• The average waiting time is usually long
• Performance depends on the size of the time quantum/slice (10 – 100 milliseconds)
• Process switching requires time; the time quantum clock is already running
• Time quantum which is set to short would result in to many process switches and this reduces CPU efficiency
• Time quantum which is too long would cause poor response to short interactive request (would result to
FIFO)
• Each process is permanently assigned to one queue based on process priority, size or process type
• If a process utilizes too much CPU time it will be moved to a lower priority queue