30-03-2011, 11:50 AM
[attachment=11319]
Scheduling Objectives
Enforcement of fairness
in allocating resources to processes
Enforcement of priorities
Make best use of available system resources
Give preference to processes holding key resources.
Give preference to processes exhibiting good behavior.
Degrade gracefully under heavy loads.
Program Behavior Issues
I/O boundedness
short burst of CPU before blocking for I/O
CPU boundedness
extensive use of CPU before blocking for I/O
Urgency and Priorities
Frequency of preemption
Process execution time
Time sharing
amount of execution time process has already received
Basic Concepts
Maximum CPU utilization obtained with multiprogramming.
CPU-I/O Burst Cycle
Process execution consists of a cycle of CPU execution and I/O wait.
Levels of Scheduling
High Level Scheduling or Job Scheduling
Selects jobs allowed to compete for CPU and other system resources.
Intermediate Level Scheduling or Medium Term Scheduling
Selects which jobs to temporarily suspend/resume to smooth fluctuations in system load.
Low Level (CPU) Scheduling or Dispatching
Selects the ready process that will be assigned the CPU.
Ready Queue contains PCBs of processes
CPU Scheduler
Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them.
Non-preemptive Scheduling
Once CPU has been allocated to a process, the process keeps the CPU until
Process exits OR
Process switches to waiting state
Preemptive Scheduling
Process can be interrupted and must release the CPU.
Need to coordinate access to shared data
CPU scheduling decisions may take place when a process:
switches from running state to waiting state
switches from running state to ready state
switches from waiting to ready
terminates
Scheduling under 1 and 4 is non-preemptive.
All other scheduling is preemptive