Presentation is loading. Please wait.

Presentation is loading. Please wait.

TDC 311 Process Scheduling.

Similar presentations


Presentation on theme: "TDC 311 Process Scheduling."— Presentation transcript:

1 TDC 311 Process Scheduling

2 Three Different Types There are three different types of process scheduling Short-term - decision as to which available process will be executed by the processor Medium-term - decision to add to the number of processes that are partially or fully in main memory Long-term - decision to add to the pool of processes

3 Scheduling Criteria What criteria might an OS use to select a particular scheduling algorithm? Response time - Interval of time from the submission of request until the response begins to be received Turnaround time - Interval of time between the submission of a process and its completion. Good measure for batch jobs

4 Scheduling Criteria Continued
Deadline - Time by which a processor must complete an assignment. Used in real-time systems Predictability - A given job should run in about the same amount of time and at about the same cost regardless of the load on the system Throughput - The number of processes completed per unit of time

5 Scheduling Criteria Continued
Processor utilization - Percentage of time that the processor is busy Fairness - In absence of priorities and such, all processes should be treated equally However, priority systems are often used, which can alter the concept of fairness. (We will look at an example of a priority system later.)

6 Scheduling Algorithms
For each of the scheduling algorithms, the following data will be used: Process Arrival Time Service Time(Burst Time)

7 1. First-come, First-served
Simple algorithm, but if short (time) processes arrive after long (time) processes, short processes wait a long time. Favors CPU bound processes over I/O bound processes.

8 2. Shortest Job First Also known as shortest process next
Non-preemptive

9 3. Shortest Remaining Time
Essentially same algorithm as shortest job first, except… Preemptive

10 4. Round-robin q=1

11 5. Round-robin q=4

12 Multi-level Queues Most modern OSs use some form of multi-level queues

13 Multi-level Queues with Feedback
But systems with feedback are even more prevalent

14 Example: VAX/VMS Scheduler always chooses from the head of the highest priority queue Priorities can be raised or lowered. For example, process requests I/O? Priority raised. Time slice expires? Priority dropped. Terminal I/O requested? Priority raised

15 Example: VAX/VMS Timesharing processes have priority 0-15, can go up or down, but always <= 15 Real-time processes have priority 16-31

16 Example: Windows 2000 Windows 2000 implements a priority-driven, preemptive scheduling system - the highest- priority runnable (ready) thread always runs When a thread is selected to run, it runs for an amount of time called a quantum A quantum is the length of time a thread is allowed to run before Windows interrupts the thread to find out whether another thread at the same priority level or higher is waiting to run or whether the thread’s priority needs to be reduced

17 Example: Windows 2000 Thread dispatching occurs at dispatch level and is triggered by any of the following events: A thread becomes ready to execute A thread leaves the running state because its time quantum ends, it terminates, or it enters a wait state A thread’s priority changes

18 Example: Windows 2000 When Windows 2000 selects a new thread to run, it performs a context switch Windows uses 32 priority levels, ranging from 0 to 31. Levels denote real-time levels, while levels 1-15 denote variable (dynamic) levels. Level 0 is reserved for the zero page thread Level 31 denotes real-time time critical; level 16 denotes real-time idle; dynamic levels are broken into high, above normal, normal, below normal, and idle groups

19 Example: Windows 2000 The thread states are as follows: Ready
Standby - selected to run next on a particular processor Running Waiting - waiting for an event Transition - ready for execution but is paged out of memory Terminated Initialized - while a thread is being created


Download ppt "TDC 311 Process Scheduling."

Similar presentations


Ads by Google