Chapter 5: CPU Scheduling!

Size: px
Start display at page:

Download "Chapter 5: CPU Scheduling!"

Transcription

1 Chapter 5: CPU Scheduling Operating System Concepts 8 th Edition, Silberschatz, Galvin and Gagne 2009

2 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Linux Example Operating System Concepts 8 th Edition 2 Silberschatz, Galvin and Gagne 2009

3 Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various CPU-scheduling algorithms To discuss evaluation criteria for selecting a CPUscheduling algorithm for a particular system Operating System Concepts 8 th Edition 3 Silberschatz, Galvin and Gagne 2009

4 Basic Concepts The objective of multiprogramming is to have some process running at all time, to maximum CPU utilization. CPU I/O Burst Cycle: u Process execution consists of a cycle of CPU execution and I/O wait u Process execution begins with a CPU burst that is followed by an I/O burst, which is followed by another CPU burst, then another I/O burst, and so on,.. The final CPU burst ends the process. Operating System Concepts 8 th Edition 4 Silberschatz, Galvin and Gagne 2009

5 Alternating Sequence of CPU And I/O Bursts Operating System Concepts 8th Edition 5 Silberschatz, Galvin and Gagne 2009

6 Basic Concepts CPU burst distribution A large number of short CPU bursts and a small number of long CPU bursts. An I/O bound program has many short CPU bursts. A CPU bound program has few long CPU bursts. Operating System Concepts 8 th Edition 6 Silberschatz, Galvin and Gagne 2009

7 Histogram of CPU-burst Times A large number of short CPU bursts small number of long CPU bursts Operating System Concepts 8th Edition 7 Silberschatz, Galvin and Gagne 2009

8 CPU Scheduler When the CPU becomes idle, the OS must select from among the processes in memory that are ready to execute, and allocates the CPU to one of them. The selection process is carried out by the short-term scheduler (CPU scheduler ). Operating System Concepts 8 th Edition 8 Silberschatz, Galvin and Gagne 2009

9 CPU Scheduler CPU scheduling decisions may take place when a process: 1. Switches from running state to the waiting state(result of I/o request or wait for the termination of one of the child processes). 2. Switches from running state to ready state(interrupt). 3. Switches from waiting state to ready state(completion of I/O) 4. Terminates Scheduling under only 1 and 4 is nonpreemptive or cooperative. All other scheduling is preemptive Operating System Concepts 8 th Edition 9 Silberschatz, Galvin and Gagne 2009

10 Preemptive scheduling Under nonpreemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state. Windows 95 and all subsequent versions of windows OS have used preemptive scheduling. Operating System Concepts 8 th Edition 10 Silberschatz, Galvin and Gagne 2009

11 Dispatcher The Dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler; this involves: switching context switching to user mode jumping to the proper location in the user program to restart that program It should be fast. Dispatch latency the time it takes for the dispatcher to stop one process and start another running Operating System Concepts 8 th Edition 11 Silberschatz, Galvin and Gagne 2009

12 Scheduling Criteria CPU utilization keep the CPU as busy as possible. Throughput # of processes that complete their execution per time unit(10 processes/second) Turnaround time amount of time to execute a particular process(the interval from the time of submission of a process to the time of completion, waiting to get into memory, waiting in the ready queue, executing on the CPU, doing I/O). Waiting time the amount of times a process has been waiting in the ready queue Response time amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment) Operating System Concepts 8 th Edition 12 Silberschatz, Galvin and Gagne 2009

13 Scheduling Algorithm Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time Operating System Concepts 8 th Edition 13 Silberschatz, Galvin and Gagne 2009

14 First-Come, First-Served (FCFS) Scheduling Jobs are scheduled in order of arrival When a process enters the ready queue, its PCB is linked onto the tail of the queue. When the CPU is free, it is allocated to the process at the head of the queue (the running process is then removed from the queue). Disadvantages: Non-preemptive : once the CPU is allocated to a process, the process keeps the CPU until it releases it, either by terminating or requesting I/O. The average waiting time is often quite long. Operating System Concepts 8 th Edition 14 Silberschatz, Galvin and Gagne 2009

15 example Process Burst Time P 1 24 P 2 3 P 3 3 Suppose that the processes arrive in the order: P 1, P 2, P 3 The Gantt Chart for the schedule is: P 1 P 2 P Waiting time for P 1 = 0; P 2 = 24; P 3 = 27 Average waiting time: ( )/3 = 17 Operating System Concepts 8 th Edition 15 Silberschatz, Galvin and Gagne 2009

16 FCFS Scheduling (Cont) Suppose that the processes arrive in the order P 2, P 3, P 1 The Gantt chart for the schedule is: 0 P 2 P 3 Waiting time for P 1 = 6; P 2 = 0 ; P 3 = 3 Average waiting time: ( )/3 = 3 Much better than previous case Convoy effect as short processes go behind long process à lower CPU and device utilization. P Operating System Concepts 8 th Edition 16 Silberschatz, Galvin and Gagne 2009

17 Convoy effect: example Assume we have one CPU-bound process, P1, and many I/O-bound processes. P2-P5 P5 P4 P3 P2 P1 The CPU-bound process P1 will get and hold the CPU. Ready Queue CPU Running P1 I/ O Queue P5 P4 P3 I/O device Running P2 Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009

18 Convoy effect: example During this time, all the other processes will finish their I/0 and will move into the ready queue, waiting for the CPU Ready Queue CPU P5 P4 P3 P2 Running P1 I/ O Queue I/O device Idle Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009

19 Convoy effect: example Eventually, the CPU-bound process finishes its CPU burst and moves to an I/0 device. Ready Queue CPU P5 P4 P3 Running P2 I/ O Queue I/O device Running P1 Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009

20 Convoy effect: example All the I/O-bound processes, which have short CPU bursts, execute quickly and move back to the I/0 queues. Ready Queue At this point, the CPU sits idle. CPU Idle I/ O Queue P5 P4 P3 P2 I/O device Running P1 Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009

21 Convoy effect: example The CPU-bound process will then move back to the ready queue and be allocated the CPU. Again, all the I/O processes end up waiting in the ready queue until the CPUbound process is done. Ready Queue CPU Running P1 I/ O Queue P5 P4 P3 I/O device Running P2 Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009

22 Shortest-Job-First (SJF) Scheduling This algorithm associates with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time, if the next CPU bursts of two processes are the same, FCFS scheduling is used. Two schemes: Nonpreemptive once CPU given to the process it cannot be preempted until completes its CPU burst Preemptive if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is known as the Shortest-Remaining-Time-First (SRTF) Operating System Concepts 8 th Edition 22 Silberschatz, Galvin and Gagne 2009

23 Examples of SJF Example1: ProcessArrival Time Burst Time P P P P SJF scheduling chart P 4 P 3 P Average waiting time = ( ) / 4 = 7 Compare with FCFS AWT=( )/4=10.25 P 2 24 Operating System Concepts 8 th Edition 23 Silberschatz, Galvin and Gagne 2009

24 Shortest-Job-First (SJF) Scheduling Example2: Process Arrival Time Burst Time P P P P Non preemptive SJF Average waiting time = ( )/4 = 4 P 1 P 3 P 2 P P 1 (7) P 2 (4) P 3 (1) P 4 (4) P 1 s wating time = 0 P 2 s wating time = 6 P 3 s wating time = 3 P 4 s wating time = 7 Operating System Concepts 8 th Edition 24 Silberschatz, Galvin and Gagne 2009

25 Shortest-Job-First (SJF) Scheduling Example3: Process Arrival Time Burst Time P P P P Preemptive SJF(SRTF) P 1 P 2 P 3 P 2 P 4 P 1 Average waiting time = ( )/4 = P P 1 (7) 1 (5) P 2 (4) P 2 (2) P 3 (1) P 4 (4) 16 P 1 s wating time = 9 P 2 s wating time = 1 P 3 s wating time = 0 P 4 s wating time = 2 Operating System Concepts 8 th Edition 25 Silberschatz, Galvin and Gagne 2009

26 Shortest-Job-First (SJF) Scheduling SJF is optimal gives minimum average waiting time for a given set of processes The difficulty is knowing the length of the next CPU request. Operating System Concepts 8 th Edition 26 Silberschatz, Galvin and Gagne 2009

27 Prediction of the Length of the Next CPU Burst Operating System Concepts 8th Edition 27 Silberschatz, Galvin and Gagne 2009

28 Priority Scheduling A priority number (integer) is associated with each process The CPU is allocated to the process with the highest priority (smallest integer highest priority in Unix but lowest in Java) Equal-priority processes are scheduled in FCFS order. Preemptive: preempt the CPU if the priority of the newly arrived process is higher than the priority of the currently running process. Nonpreemptive: put the new process at the head of the ready queue. Operating System Concepts 8 th Edition 28 Silberschatz, Galvin and Gagne 2009

29 Priority Scheduling SJF is a priority scheduling where priority is the predicted next CPU burst time Problem Starvation low priority processes may never execute Solution Aging as time progresses increase the priority of the process (for example : 1 every 15 minutes) Operating System Concepts 8 th Edition 29 Silberschatz, Galvin and Gagne 2009

30 Priority Scheduling Example : Process Burst Time priority P P P P p5 5 2 All arrived at time 0. The Gantt chart for the schedule is: P 2 P P 1 5 P The AWT is ( )/5 = P 4 19 Operating System Concepts 8 th Edition 30 Silberschatz, Galvin and Gagne 2009

31 Priority Scheduling Example: Process arrival time Burst length Priority P P P P P Gantt chart: Non-preemptive priority scheduling P2 P1 P5 P3 P Gantt chart: Preemptive priority scheduling P2 P1 P5 P1 P3 P Operating System Concepts 8 th Edition 31 Silberschatz, Galvin and Gagne 2009

32 Round Robin (RR) Is designed especially for time-sharing systems. Similar to FCFS, but it is Preemptive to enable the system to switch between processes. Each process gets a small unit of CPU time (time quantum or time slice), usually milliseconds. The Ready queue is FIFO (new processes are added to the tail of the queue.) The CPU scheduler picks the first process from the ready queue, set a timer to interrupt after 1 time quantum, and dispatch the process. Operating System Concepts 8 th Edition 32 Silberschatz, Galvin and Gagne 2009

33 Round Robin (RR) One of two things will happen The process may have a CPU burst of < 1 time quantum à the process itself will release the CPU voluntarily. The CPU burst of the currently running process > 1 time quantum à the timer will go off and will cause an interrupt to the OS à a context switch will be executed, and the process will be put at the tail of the ready queue. The CPU scheduler will then select the next process in the ready queue. Typically, higher average turnaround than SJF, but better response Operating System Concepts 8 th Edition 33 Silberschatz, Galvin and Gagne 2009

34 Example1: Time quantum = 4 Process Burst Time P 1 24 P 2 3 P 3 3 The Gantt chart is: Round Robin (RR) P 1 P 2 P 3 P 1 P 1 P 1 P 1 P AWT(6(10-4)+4+7)/3 = 5.66 Operating System Concepts 8 th Edition 34 Silberschatz, Galvin and Gagne 2009

35 Round Robin (RR) Example2: Time quantum = 20 Process Burst Time Wait Time P = 81 P P = 94 P = 97 P 1 P 2 P 3 P 4 P 1 P 3 P 4 P 1 P 3 P P 1 (53) 57 P 1 (33) 24 P 1 (13) P 20 2 (17) P P 3 (48) 3 (68) 17 P 3 (28) P 3 (8) P 4 (24) P 4 (4) Average wait time = ( )/4 = 73 Operating System Concepts 8 th Edition 35 Silberschatz, Galvin and Gagne 2009

36 Round Robin (RR) If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)*q time units until its next time quantum. (Ex: 5 processes, TQ = 20 milliseconds, each process will get up to 20 milliseconds every 100 milliseconds. The Performance of RR depends heavily on the size of the TQ. TQ large FCFS TQ small TQ must be large (but not too large) with respect to context switch time, otherwise overhead is too high Operating System Concepts 8 th Edition 36 Silberschatz, Galvin and Gagne 2009

37 Time Quantum and Context Switch Time Operating System Concepts 8th Edition 37 Silberschatz, Galvin and Gagne 2009

38 Turnaround Time Varies With The Time Quantum The average TurnAroundTime of a set of process does not necessarily improve as the TQ size increase. The AVG TAT can be improved if most process finish their next CPU burst in a single time quantum. Operating System Concepts 8th Edition 38 Silberschatz, Galvin and Gagne 2009

39 Multilevel Queue Processes are classified into different groups. Each group have different response-time requirements à different scheduling needs. A multilevel queue scheduling algorithm partitions the Ready queue into separate queues: foreground (interactive) background (batch) Operating System Concepts 8 th Edition 39 Silberschatz, Galvin and Gagne 2009

40 Multilevel Queue Each queue has its own scheduling algorithm foreground RR background FCFS Scheduling must be done between the queues Fixed priority preemptive scheduling; (i.e., serve all from foreground then from background). Possibility of starvation. Time slice each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR, 20% to background in FCFS Operating System Concepts 8 th Edition 40 Silberschatz, Galvin and Gagne 2009

41 Multilevel Queue Scheduling Operating System Concepts 8th Edition 41 Silberschatz, Galvin and Gagne 2009

42 Multilevel Feedback Queue Implement multiple ready queues Allows process to move between queues. Just like multilevel queue scheduling, but assignments are not static Different queues may be scheduled using different algorithms Multilevel feedback queue-scheduling algorithm allows a process to move between the various queues; aging can be implemented this way Operating System Concepts 8 th Edition 42 Silberschatz, Galvin and Gagne 2009

43 Multilevel Feedback Queue Multilevel-feedback-queue scheduler defined by the following parameters: number of queues scheduling algorithms for each queue method used to determine when to upgrade and downgrade a process The most general CPU-scheduling algorithm. The most complex algorithm. Operating System Concepts 8 th Edition 43 Silberschatz, Galvin and Gagne 2009

44 Example of Multilevel Feedback Queue Three queues: Q 0 RR with time quantum 8 milliseconds Q 1 RR time quantum 16 milliseconds Q 2 FCFS Scheduling A new job enters queue Q 0 which is served FCFS. When it gains CPU, job receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to queue Q 1. At Q 1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue Q 2. AT Q 2 job is served FCFS only when queue 0 and queue 1 are empty. Operating System Concepts 8 th Edition 44 Silberschatz, Galvin and Gagne 2009

45 Multilevel Feedback Queues Operating System Concepts 8th Edition 45 Silberschatz, Galvin and Gagne 2009

46 Thread Scheduling Distinction between user-level and kernel-level threads On OSs that support them, it is the kernel-level threads-not processes- that are being scheduled by OS. User-level threads are managed by a thread library and the kernel is unaware of them. To run on CPU, the user level threads must be mapped to an associated kernel-level thread. It may use a lightweight process(lwp). contention scope: one distinction between user-level and kernel-level threads lies in how they are scheduled. Operating System Concepts 8 th Edition 46 Silberschatz, Galvin and Gagne 2009

47 Thread Scheduling Many-to-one and many-to-many models, thread library schedules user-level threads to run on LWP. Known as process-contention scope (PCS) since scheduling competition takes place among threads belonging to the same process. PCS is done according to preempt priority. PTHREAD SCOPE PROCESS schedules threads using PCS scheduling. Kernel thread scheduled onto available CPU is system-contention scope (SCS) competition takes place among all threads in system Systems using the one-to-one model schedule threads using only SCS. PTHREAD SCOPE SYSTEM schedules threads using SCS scheduling. Operating System Concepts 8 th Edition 47 Silberschatz, Galvin and Gagne 2009

48 Multiple-Processor Scheduling CPU scheduling more complex when multiple CPUs are available Different rules for homogeneous processors (Identical processors in terms of their functionality) or heterogeneous processors. 1. Asymmetric multiprocessing: All scheduling decisions, I/O processing, and other system activities handled by a single processor the master server. The other processors execute only user code. Simple because only one processor accesses the system data structures, reducing the need for data sharing. Operating System Concepts 8 th Edition 48 Silberschatz, Galvin and Gagne 2009

49 Multiple-Processor Scheduling CPU scheduling more complex when multiple CPUs are available Different rules for homogeneous processors (Identical processors in terms of their functionality) or heterogeneous processors. 1. Asymmetric multiprocessing: 2. Symmetric multiprocessing (SMP): each processor is self-scheduling, all processes in common ready queue, or each has its own private queue of ready processes Multiple processors try to access and update a common data structures. So, scheduler must be programmed carefully. Must ensure that 2 processors don t choose the same process. Operating System Concepts 8 th Edition 49 Silberschatz, Galvin and Gagne 2009

50 Linux Scheduling Linux Scheduler is a preemptive, priority-based algorithm with 2 separate priority ranges: Two priority ranges: time-sharing and real-time A real-time range from 0 to 99 à Longer time quantum A nice value ranging from 100 to 140 à Shorter time quantum Operating System Concepts 8th Edition 50 Silberschatz, Galvin and Gagne 2009

51 Linux Scheduling The kernel maintains a list of all runnable tasks in a runqueue data structure. Each runqueue contains two priority arrays : Active: contains all tasks with time remaining in their time slices Expired: contains all expired tasks. Operating System Concepts 8 th Edition 51 Silberschatz, Galvin and Gagne 2009

52 List of Tasks Indexed According to Priorities The scheduler chooses the task with the highest priority from the active array for execution on the CPU. When the active array is empty à the 2 arrays are exchanged (the expired array becomes the active array, and vice versa). Operating System Concepts 8th Edition 52 Silberschatz, Galvin and Gagne 2009

53 Deterministic modeling Algorithm Evaluation takes a particular predetermined workload and defines the performance of each algorithm for that workload More examples P: 214 Simple and fast Requires exact numbers for input and its answers apply only for those data Queueing models rate at which new processes arrive, ratio of CPU bursts to I/O times, distribution of CPU burst times and I/O burst times can be measured and then approximated or estimated result is a mathematical formula describing it From these it is possible to compute the average throughput, utilization, waiting time, and so on difficult to work Operating System Concepts 8 th Edition 53 Silberschatz, Galvin and Gagne 2009

54 Simulations Algorithm Evaluation run computer simulations of the different proposed algorithms data to drive the simulation can be randomly generated better alternative when possible is to generate trace tapes expensive Implementation The only completely accurate way to evaluate a scheduling algorithm is to code it up, put it in the operating system, and see how it works. high cost (coding and user reaction) Operating System Concepts 8 th Edition 54 Silberschatz, Galvin and Gagne 2009

55 Simulations Operating System Concepts 8th Edition 55 Silberschatz, Galvin and Gagne 2009

56 Conclusion We ve looked at a number of different scheduling algorithms. Which one works the best is application dependent. General purpose OS will use priority based, round robin, preemptive Real Time OS will use priority, no preemption. Operating System Concepts 8 th Edition 56 Silberschatz, Galvin and Gagne 2009

57 End of Chapter 5 Operating System Concepts 8 th Edition, Silberschatz, Galvin and Gagne 2009

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Linux Example

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling 1.1 Maximum CPU utilization obtained with multiprogramming CPU I/O Burst

More information

Objectives. 5.1 Basic Concepts. Scheduling Criteria. Multiple-Processor Scheduling. Algorithm Evaluation. Maximum CPU.

Objectives. 5.1 Basic Concepts. Scheduling Criteria. Multiple-Processor Scheduling. Algorithm Evaluation. Maximum CPU. Chapter 5: Process Scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms To discuss evaluation criteria for selecting the CPU-scheduling algorithm for a particular

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Chapter 5: CPU Scheduling. Operating System Concepts 7 th Edition, Jan 14, 2005

Chapter 5: CPU Scheduling. Operating System Concepts 7 th Edition, Jan 14, 2005 Chapter 5: CPU Scheduling Operating System Concepts 7 th Edition, Jan 14, 2005 Silberschatz, Galvin and Gagne 2005 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Oct-03 1 Basic Concepts Maximum CPU utilization

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

More information

Agenda. CPU Scheduling. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU And I/O Bursts

Agenda. CPU Scheduling. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU And I/O Bursts TDDB3: Concurrent programming and operating systems [SGG7] Chapter 5 Agenda CPU Scheduling Introduce CPU scheduling Describe various CPU scheduling algorithms Discuss evaluation criteria of CPU scheduling

More information

Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition

Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

CS720 - Operating Systems. CPU Scheduling

CS720 - Operating Systems. CPU Scheduling CS720 - Operating Systems CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Procesor Scheduling Real-Time Scheduling Algorithm Evaluation Slides derived from material in

More information

Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation

Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 1 Basic Concepts Maximum CPU utilization obtained

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Chapter 6: 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming.

More information

Basic Concepts. Chapter 6: CPU Scheduling. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Basic Concepts. Chapter 6: CPU Scheduling. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts Chapter 6: CPU Scheduling Basic Concepts Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Maximum CPU utilization obtained

More information

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms Chapter 5: Process Scheduling To discuss evaluation criteria for selecting the CPUscheduling algorithm for a particular

More information

Chapter 5: Process Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: Process Scheduling. Operating System Concepts 8 th Edition, Chapter 5: Process Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling

More information

Chapter 5: Process Scheduling. Operating System Concepts with Java 8 th Edition

Chapter 5: Process Scheduling. Operating System Concepts with Java 8 th Edition Chapter 5: Process Scheduling Operating System Concepts with Java 8 th Edition 5.1 Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms

More information

Chapter 6: CPU Scheduling. Previous Lectures. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Chapter 6: CPU Scheduling. Previous Lectures. Basic Concepts. Alternating Sequence of CPU And I/O Bursts Previous Lectures Multithreading Memory Layout Kernel vs User threads Representation in OS Difference between thread and process Thread scheduling Mapping between user and kernel threads Multithreading

More information

Module 6: CPU Scheduling. Basic Concepts

Module 6: CPU Scheduling. Basic Concepts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Silberschatz,

More information

Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms

Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Operating System Concepts 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle

More information

Module 6: CPU Scheduling. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Module 6: CPU Scheduling. Basic Concepts. Alternating Sequence of CPU And I/O Bursts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Basic Concepts

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

More information

CPU Scheduling: Basic Concepts

CPU Scheduling: Basic Concepts CPU Scheduling: Basic Concepts Idea: Maximum CPU utilization obtained with multiprogramming" CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait" Dispatcher grants CPU

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Module 5: CPU Scheduling

Module 5: CPU Scheduling Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Operating System Concepts 5.1 Silberschatz and

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling 1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 2 Basic Concepts Maximum CPU utilization

More information

Chapter 5: Process Scheduling

Chapter 5: Process Scheduling Chapter 5: Process Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling

More information

Chapter 6: CPU Scheduling. Basic Concepts

Chapter 6: CPU Scheduling. Basic Concepts 1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm Evaluation Objectives To introduce

More information

CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University EECS 3221 Operating System Fundamentals No.4 CPU scheduling Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University CPU Scheduling CPU scheduling is the basis of multiprogramming

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Edited by Ghada Ahmed, PhD ghada@fcih.net Silberschatz, Galvin and Gagne 2013 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process

More information

CPU Scheduling. Chapter 5

CPU Scheduling. Chapter 5 CPU Scheduling Chapter 5 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 CPU burst distribution

More information

Lecture 5 Process Scheduling (chapter 5)

Lecture 5 Process Scheduling (chapter 5) Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 5 Process Scheduling (chapter 5) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The slides

More information

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

Introduction to process scheduling. Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms

Introduction to process scheduling. Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms Lecture Overview Introduction to process scheduling Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms First-come, first-serve Shortest-job-first Priority Round-robin

More information

CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts

CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts Basic Concepts P CPU Scheduling CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating

More information

CPU Scheduling. Operating System Concepts. Alternating Sequence of CPU And I/O Bursts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times

CPU Scheduling. Operating System Concepts. Alternating Sequence of CPU And I/O Bursts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times Operating System Concepts Module 5: CPU SCHEDULING Andrzej Bednarski, Ph.D. student Department of Computer and Information Science Linköping University, Sweden CPU Scheduling Basic Concepts Scheduling

More information

Chapter 5: CPU Scheduling!

Chapter 5: CPU Scheduling! Chapter 5: CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! Multiple-Processor Scheduling! Real-Time Scheduling! Algorithm Evaluation! 6.1! Basic Concepts! Long-term scheduler

More information

CPU Scheduling CS 571. CPU - I/O Burst Cycle. Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process

CPU Scheduling CS 571. CPU - I/O Burst Cycle. Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process CPU Scheduling CS 571 1 CPU - I/O Burst Cycle Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process 2 1 Basic Concepts CPU I/O Burst Cycle Process execution consists

More information

Types of jobs. CPU-bound vs. I/O-bound. Batch, Interactive, real time. Maximum CPU utilization obtained with multiprogramming

Types of jobs. CPU-bound vs. I/O-bound. Batch, Interactive, real time. Maximum CPU utilization obtained with multiprogramming CPU Scheduling Types of jobs CPU-bound vs. I/O-bound Maximum CPU utilization obtained with multiprogramming Batch, Interactive, real time Different goals, affects scheduling policies CPU Scheduler Selects

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 5: PROCESS SCHEDULING Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor

More information

CS420: Operating Systems

CS420: Operating Systems CPU Scheduling James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Scheduling Concepts

More information

Threads (Ch.4) ! Many software packages are multi-threaded. ! A thread is sometimes called a lightweight process

Threads (Ch.4) ! Many software packages are multi-threaded. ! A thread is sometimes called a lightweight process Threads (Ch.4)! Many software packages are multi-threaded l Web browser: one thread display images, another thread retrieves data from the network l Word processor: threads for displaying graphics, reading

More information

ECE3055 Computer Architecture and Operating Systems

ECE3055 Computer Architecture and Operating Systems ECE3055 Computer Architecture and Operating Systems Lecture: CPU Scheduling Prof. Hsien-Hsin Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology H.-H. S. Lee 1 Overview

More information

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

CPU Scheduling. Multiprogrammed OS

CPU Scheduling. Multiprogrammed OS CPU Scheduling Multiprogrammed OS Efficient Use of Processor By switching between jobs Thread scheduling and process scheduling often used interchangeably Which is done depends on implementation of O/S.

More information

Chapter 5: CPU Scheduling. Operating System Concepts with Java 8 th Edition

Chapter 5: CPU Scheduling. Operating System Concepts with Java 8 th Edition Chapter 5: CPU Scheduling 5.1 Silberschatz, Galvin and Gagne 2009 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU

More information

CPU Scheduling. Date. 2/2/2004 Operating Systems 1

CPU Scheduling. Date. 2/2/2004 Operating Systems 1 CPU Scheduling Date 2/2/2004 Operating Systems 1 Basic concepts Maximize CPU utilization with multi programming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling

More information

Chapter 5: Process Scheduling. Chapter 5: Process Scheduling

Chapter 5: Process Scheduling. Chapter 5: Process Scheduling Chapter 5: Process Scheduling Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Operating Systems Examples Java Thread Scheduling Algorithm

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 5: CPU Scheduling Zhi Wang Florida State University Contents Basic concepts Scheduling criteria Scheduling algorithms Thread scheduling

More information

Lecture 5 CPU Scheduling

Lecture 5 CPU Scheduling Lecture 5 CPU Scheduling (Uniprocessor System) 1 Lecture Contents 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 2 Switching CPU among processes in multiprogrammed OSs makes a computer

More information

Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. CPU Scheduler

Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. CPU Scheduler Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

5.1 Basic Concepts. Chapter 5: Process Scheduling. Alternating Sequence of CPU And I/O Bursts. 5.1 Basic Concepts

5.1 Basic Concepts. Chapter 5: Process Scheduling. Alternating Sequence of CPU And I/O Bursts. 5.1 Basic Concepts 5.1 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 CPU burst distribution Chapter 5: Process

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various scheduling algorithms

More information

Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Process Scheduling. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Process Scheduling. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University. Process Scheduling Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Basic Concepts Scheduling Criteria Scheduling Algorithms Windows NT Scheduler Topics Covered

More information

ECE3055 Computer Architecture and Operating Systems

ECE3055 Computer Architecture and Operating Systems ECE3055 Computer Architecture and Operating Systems Lecture: CPU Scheduling Prof. Hsien-Hsin Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology H.-H. S. Lee 1 Overview

More information

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts CS307 Basic Concepts Maximize CPU utilization obtained with multiprogramming CPU Scheduling CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

More information

CS307 Operating Systems CPU Scheduling

CS307 Operating Systems CPU Scheduling CS307 CPU Scheduling Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2016 Basic Concepts Maximize CPU utilization obtained with multiprogramming CPU I/O Burst

More information

CPU scheduling. Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times. CPU Scheduler

CPU scheduling. Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times. CPU Scheduler CPU scheduling Alternating Sequence of CPU And I/O Bursts Maximum CPU utilization is obtained by multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

More information

Chapter 5: Process Scheduling

Chapter 5: Process Scheduling Chapter 5: Process Scheduling Chapter 5: Process Scheduling 5.1 Basic Concepts 5.2 Scheduling Criteria 5.3 Scheduling Algorithms 5.3.1 First-Come, First-Served Scheduling 5.3.2 Shortest-Job-First Scheduling

More information

Chapter 5 Process Scheduling

Chapter 5 Process Scheduling Chapter 5 Process Scheduling CPU Scheduling Objective: Basic Scheduling Concepts CPU Scheduling Algorithms Why Multiprogramming? Maximize CPU/Resources Utilization (Based on Some Criteria) CPU Scheduling

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition,

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition, Chapter 6: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

More information

Introduction to Scheduling 1

Introduction to Scheduling 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms FCFS, SJF, RR Exponential Averaging Multi-level Queue Scheduling Performance Evaluation Scheduling Terminology Scheduling Terminology

More information

Chapter 5 CPU Scheduling

Chapter 5 CPU Scheduling Chapter 5 CPU Scheduling CPU Scheduling 1 Outline! Basic Concepts.! Scheduling Criteria.! Scheduling Algorithms.! Multiple-Processor Scheduling.! Thread Scheduling.! Operating Systems Examples.! Algorithm

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition Chapter 5: CPU Scheduling Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

More information

Operating System. Lecture Slides By Silberschatz, Galvin & Gagne (8 th Edition) Modified By: Prof. Mitul K. Patel

Operating System. Lecture Slides By Silberschatz, Galvin & Gagne (8 th Edition) Modified By: Prof. Mitul K. Patel Operating System Lecture Slides By Silberschatz, Galvin & Gagne (8 th Edition) Modified By: Prof. Mitul K. Patel Shree Swami Atmanand Saraswati Institute of Technology, Surat January 2012 Outline 1 Chapter

More information

Chapter 4: CPU Scheduling. Basic Concepts. Objectives. Basic Concepts Scheduling Criteria Scheduling Algorithms. Operating Systems Examples

Chapter 4: CPU Scheduling. Basic Concepts. Objectives. Basic Concepts Scheduling Criteria Scheduling Algorithms. Operating Systems Examples Chapter 4: CPU Scheduling Chapter 4: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Operating Systems Examples, Silberschatz, Galvin and Gagne 2009

More information

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Based on original slides by Silberschatz, Galvin and Gagne 1 Basic Concepts CPU I/O Burst Cycle Process execution

More information

Operating Systems Fall 2012 Lecture 4: CPU Scheduling

Operating Systems Fall 2012 Lecture 4: CPU Scheduling 482000000000357 Operating Systems Fall 2012 Lecture 4: CPU Scheduling Assist. Prof. Ediz ŞAYKOL ediz.saykol@beykent.edu.tr Operating System - Main Goals Interleave the execution of the number of processes

More information

Scheduling for uniprocessor systems Introduction

Scheduling for uniprocessor systems Introduction Politecnico di Milano Introduction Lecturer: William Fornaciari Politecnico di Milano william.fornaciari@elet.polimi.it Home.dei.polimi.it/fornacia SUMMARY Basic Concepts Scheduling Criteria Scheduling

More information

CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University

CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University CS 571 Operating Systems CPU Scheduling Angelos Stavrou, George Mason University CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms First-Come-First-Served Shortest-Job-First, Shortest-remaining-Time-First

More information

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms!

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! First-Come-First-Served! Shortest-Job-First, Shortest-remaining-Time-First! Priority Scheduling! Round Robin! Multi-level Queue!

More information

III. Process Scheduling

III. Process Scheduling Intended Schedule III. Process Scheduling Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

More information

III. Process Scheduling

III. Process Scheduling III. Process Scheduling 1 Intended Schedule Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts! Scheduling Criteria! Scheduling Algorithms! Thread Scheduling! Multiple-Processor Scheduling! Operating Systems Examples! Algorithm Evaluation!

More information

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes Scheduling Objectives CPU SCHEDULING Enforcement of fairness in allocating resources to processes Enforcement of priorities Make best use of available system resources Give preference to processes holding

More information

Scheduling. Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1

Scheduling. Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1 Scheduling Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1 Outline Introduction Types of Scheduling Scheduling Criteria FCFS Scheduling Shortest-Job-First Scheduling Priority

More information

Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks

Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks Basic Concepts CPU-I/O burst cycle - Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution

More information

CPU Scheduling. Dr. Yingwu Zhu

CPU Scheduling. Dr. Yingwu Zhu CPU Scheduling Dr. Yingwu Zhu Overview In discussing process/threads management and synchronization, we talked about context switching among processes/threads on the ready queue But we have not glossed

More information

Chapter 6 CPU Scheduling. Contents

Chapter 6 CPU Scheduling. Contents Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

Silberschatz and Galvin

Silberschatz and Galvin Silberschatz and Galvin Chapter 5 CPU Scheduling CPSC 410--Richard Furuta 01/19/99 1 Topics covered Basic concepts/scheduling criteria Non-preemptive and Preemptive scheduling Scheduling algorithms Algorithm

More information

Chapter 6 Process Scheduling

Chapter 6 Process Scheduling 1 Chapter 6 Process Scheduling CPU scheduling deals with the problem of deciding which of the processes in the ready queue is to be allocated the CPU. There are many different CPU-scheduling algorithms.

More information

CSC 539: Operating Systems Structure and Design. Spring 2006

CSC 539: Operating Systems Structure and Design. Spring 2006 CSC 539: Operating Systems Structure and Design Spring 2006 CPU scheduling historical perspective CPU-I/O bursts preemptive vs. nonpreemptive scheduling scheduling criteria scheduling algorithms: FCFS,

More information

CPU Scheduling. CPU Scheduling

CPU Scheduling. CPU Scheduling CPU Scheduling Electrical and Computer Engineering Stephen Kim (dskim@iupui.edu) ECE/IUPUI RTOS & APPS 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

More information

Announcements Project #2. Basic Concepts

Announcements Project #2. Basic Concepts Announcements Project #2 Is due at 6:00 PM on Friday Program #3 Posted tomorrow (implements scheduler) Reading Chapter 6 Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU

More information

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading Announcements Reading Chapter 5 Chapter 7 (Monday or Wednesday) Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution What are the

More information

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Basic Concepts An OS must allocate resources amongst competing processes The resource

More information

CPU Scheduling. Mehdi Kargahi School of ECE University of Tehran Spring 2008

CPU Scheduling. Mehdi Kargahi School of ECE University of Tehran Spring 2008 CPU Scheduling Mehdi Kargahi School of ECE University of Tehran Spring 2008 CPU and I/O Bursts Histogram of CPU-Burst Durations When CPU Scheduling Occurs 1. Running process switches to wait state I/O

More information

Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler

Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler CPU Scheduling Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler Short-term scheduler Ready queue may be a FIFO queue, priority queue, tree, linked list, etc.

More information

Outline. Chapter 5: Process Scheduling Yean Fu Wen Nov. 24, Basic Concepts Scheduling Criteria Scheduling Algorithms

Outline. Chapter 5: Process Scheduling Yean Fu Wen Nov. 24, Basic Concepts Scheduling Criteria Scheduling Algorithms Chapter 5: Process Scheduling Yean Fu Wen yeanfu@mail.ncyu.edu.tw Nov. 24, 2009 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms FCFS, SJF, Priority, RR, MQ, MFQ Thread Scheduling Multiple

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009! Chapter 6: CPU Scheduling Basic Concepts" Scheduling Criteria " Scheduling Algorithms" Thread Scheduling"

More information

Process Management. Processes. CS 502 Spring 99 WPI MetroWest/Southboro Campus

Process Management. Processes. CS 502 Spring 99 WPI MetroWest/Southboro Campus Process Management CS 502 Spring 99 WPI MetroWest/Southboro Campus Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Threads Interprocess Communication 1 1 Process

More information

CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University

CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University Goals for Today CPU Schedulers Scheduling Algorithms Algorithm Evaluation Metrics Algorithm details Thread Scheduling Multiple-Processor Scheduling

More information

Module 4 CPU Scheduling

Module 4 CPU Scheduling Module 4 CPU Scheduling Reading: Chapter 5 Providing some motivation and scheduling criteria. Shall study a number of different algorithms used by CPU (short-term) schedulers. Overview some advance topics

More information