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

Size: px
Start display at page:

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

Transcription

1 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 keystrokes from the user, performing spelling and grammar checking in the background l Web server: instead of creating a process when a request is received, which is time consuming and resource intensive, server creates a thread to service the request! A thread is sometimes called a lightweight process l It is comprised over a thread ID, program counter, a register set and a stack l It shares with other threads belonging to the same process its code section, data section and other OS resources (e.g., open files) l A process that has multiples threads can do more than one task at a time Slide 1

2 ! Responsiveness Benefits l One part of a program can continue running even if another part is blocked! Resource Sharing l Threads of the same process share the same memory space and resources! Economy l Much less time consuming to create and manage threads than processes l Solaris 2: creating a process is 30 times slower than creating a thread, context switching is 5 times slower! Utilization of MP Architectures l Each thread can run in parallel on a different processor Slide 2

3 Many-to-One Model! Many user-level threads mapped to single kernel thread. l Efficient - thread management done in user space l Entire process will block if a thread makes a blocking system call l Only one thread can access the kernel, no parallel processing in MP environment Slide 3

4 One-to-One! Each user-level thread maps to kernel thread. l Another thread can run when one thread makes a blocking call l Multiple threads an run in parallel on a MP machine l Overhead of creating a kernel thread for each user thread l Most implementations limit the number of threads supported! Examples - Windows - OS/2 - Linux Slide 4

5 Many-to-Many Model! Allows many user level threads to be mapped to smaller or equal number of kernel threads.! As many user threads as necessary can be created! Corresponding kernel threads can run in parallel on a multiprocessor! When a thread performs a blocking system call, the kernel can schedule another thread for execution! Allows true concurrency in a MP environment and does not restrict number of threads that can be created Slide 5

6 Java Threads! Java threads may be created by extending the Thread class or implementing the Runnable interface! Java threads are managed by the JVM l support provided at the language level l The JVM specification does not indicate how threads should be mapped to the underlying OS l Windows 95/98/NT/2000 use the one-to-one model (each Java thread maps to a kernel thread) l Solaris 2 used the many-to-many model! public MyThread extends Thread! {! public void run()! {do_stuff();}! }! MyThread t = new MyThread();! t.start();! public MyRunnable implements Runnable! {! public void run()! {do_stuff();}! }! Thread t = new Thread(new MyRunnable());! t.start(); Slide 6

7 Java Thread States Silberschatz / OS Concepts / 6e - Chapter 5 Threads Slide 7

8 CPU Scheduling (Ch.5)! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! Multiple-Processor Scheduling! Real-Time Scheduling! Algorithm Evaluation Slide 8

9 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.! Scheduling is central to OS design l CPU and almost all computer resources are scheduled before use Slide 9

10 Alternating Sequence of CPU And I/O Bursts Slide 10

11 Histogram of CPU-burst Times! CPU bursts, though different by process and computer, tend to have a frequency curve as shown above! Characterized by many short bursts and few long ones! The distribution can help in the selection of an appropriate scheduling algorithm Slide 11

12 CPU Scheduler! Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them.! CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state. 2. Switches from running to ready state. 3. Switches from waiting to ready. 4. Terminates.! Scheduling under 1 and 4 is nonpreemptive a new process must be selected for execution l Once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or switching to a waiting state! All other scheduling is preemptive. Slide 12

13 Dispatcher! Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: l switching context l switching to user mode l jumping to the proper location in the user program to restart that program! Dispatch latency time it takes for the dispatcher to stop one process and start another running. Slide 13

14 Scheduling Criteria! CPU utilization keep the CPU as busy as possible! Throughput (tasa de procesamiento) # of processes that complete their execution per time unit! Turnaround time (tiempo de ejecución) amount of time to execute a particular process l waiting to get into memory + waiting in the ready queue + executing on the CPU + I/O! Waiting time amount of time 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) Slide 14

15 ! Max CPU utilization! Max throughput Optimization Criteria! Min turnaround time! Min waiting time! Min response time! In most cases we optimize the average measure! In some circumstances we want to optimize the min or max values rather than the average e.g., minimize the max response time so all users get good service Slide 15

16 Scheduling Algorithms First-Come, First-Served (FCFS) 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: Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 16

17 Scheduling Algorithms First-Come, First-Served (FCFS) 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 3! 0!! Waiting time for P 1 = 0; P 2 = 24; P 3 = 27! Average waiting time: ( )/3 = 17 24! 27! 30! Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 17

18 FCFS Scheduling (Cont.) Suppose that the processes arrive in the order P 2, P 3, P 1! The Gantt chart for the schedule is:! Much better than previous case.! Average waiting time is generally not minimal and may vary substantially if the process CPU-burst times vary greatly Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 18

19 FCFS Scheduling (Cont.) Suppose that the processes arrive in the order P 2, P 3, P 1! The Gantt chart for the schedule is: P 2! P 3! P 1! 0! 3! 6! 30!! Waiting time for P 1 = 6; P 2 = 0 ; P 3 = 3! Average waiting time: ( )/3 = 3! Much better than previous case.! Average waiting time is generally not minimal and may vary substantially if the process CPU-burst times vary greatly Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 19

20 ! FCFS is non-preemptive FCFS Scheduling (Cont.)! Not good for time sharing systems where where each user needs to get a share of the CPU at regular intervals! Convoy effect short process(i/o bound) wait for one long CPUbound process to complete a CPU burst before they get a turn l lowers CPU and device utilization Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 20

21 Shortest-Job-First (SJR)Scheduling! Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time (on a tie use FCFS)! Two schemes: l nonpreemptive once CPU given to the process it cannot be preempted until completes its CPU burst. l preemptive if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF).! SJF is optimal gives minimum average waiting time for a given set of processes. Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 21

22 Example of Non-Preemptive SJF Process Arrival Time Burst Time P P P P ! SJF (non-preemptive) Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 22

23 Example of Non-Preemptive SJF Process Arrival Time Burst Time P P P P ! SJF (non-preemptive) P 1! P 3! P 2! P 4! 0! 3! 7! 8! 12! 16!! Average waiting time = ( )/4 = 4 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 23

24 Example of Preemptive SJF Process Arrival Time Burst Time P ! SJF (preemptive) P P P Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 24

25 Example of Preemptive SJF Process Arrival Time Burst Time P ! SJF (preemptive) P P P P 1! P 2! P 3! P 2! P 4! P 1! 0! 2! 4! 5! 7! 11! 16!! Average waiting time = ( )/4 = 3 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 25

26 Determining Length of Next CPU Burst! Can only estimate the length.! Can be done by using the length of previous CPU bursts, using exponential averaging t n τ = actual lenght of n n+ 1 = predicted value for the next CPU burst 3. α, 0 α 1 4. Define : τ n+ 1 = α tn + 1 α τ n 5. If α = 0 thenτ = τ and t is ignored 6. If α = 1thenτ n+ 1 n+ 1 = t 7. More commonly, α = 1 n n th andτ CPU burst ( ). n n is ignored 2 so recent and past history are equally weighted Slide 26

27 Prediction of the Length of the Next CPU Burst α= 1/2 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 27

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). l Can be preemptive (compares priority of process that has arrived at the ready queue with priority of currently running process) or nonpreemptive (put at the head of the ready queue)! 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. Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 28

29 Priority Scheduling Process Burst Time Priority P P2 1 1 P3 2 4 P4 1 5 P5 5 2 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 29

30 Priority Scheduling Process Burst Time Priority P P2 1 1 P3 2 4 P4 1 5 P5 5 2 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 30

31 Round Robin (RR)! Each process gets a small unit of CPU time (time quantum), usually milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.! 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.! Performance l q large FIFO l q small q must be large with respect to context switch, otherwise overhead is too high. Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 31

32 Example of RR with Time Quantum = 20 Process Burst Time P 1 53 P 2 17 P 3 68 P 4 24! The Gantt chart is: Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 32

33 Example of RR with Time Quantum = 20 Process Burst Time P 1 53 P 2 17 P 3 68 P 4 24! The Gantt chart is: P 1! P 2! P 3! P 4! P 1! P 3! P 4! P 1! P 3! P 3! 0! 20! 37! 57! 77! 97! 117! 121! 134! 154! 162!! Typically, higher average turnaround than SJF, but better response. Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 33

34 Time Quantum and Context Switch Time A smaller time quantum increase context switches Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 34

35 Time Quantum and Turnaround Time Process Burst Time P 1 6 P 2 3 P 3 1 P 4 7 A smaller quantum increases or decreases turnaround time? Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 35

36 Turnaround Time Varies With The Time Quantum! The average turnaround time of a set of processes does not necessarily improve as the time quantum size increases! In general, it can be improved if most processes finish their next CPU burst in a single time quantum Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 36

37 Multilevel Queue! Ready queue is partitioned into separate queues: foreground background! Each queue has its own scheduling algorithm, foreground RR background FCFS! Scheduling must be done between the queues. l Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation. l 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 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 37

38 Multilevel Queue Foreground processes Process Burst Time P 1 4 P 2 3 P 3 1 P 4 4 Background processes Process Burst Time P 5 3 P 6 2 P 7 1 P 8 2 foreground RR (quantum=1) background FCFS Time slice 80% (8ms) to foreground in RR, 20% to background in FCFS

39 Multilevel Queue Scheduling! Each queue has absolute priority over lower priority queues! A lower priority process that is executing would be preempted if a higher priority process arrived Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 39

40 Multilevel Feedback Queue! A process can move between the various queues; aging can be implemented this way.! Multilevel-feedback-queue scheduler defined by the following parameters: l number of queues l scheduling algorithms for each queue l method used to determine when to upgrade a process l method used to determine when to demote a process l method used to determine which queue a process will enter when that process needs service Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 40

41 Example of Multilevel Feedback Queue! Three queues: l Q 0 time quantum 8 milliseconds l Q 1 time quantum 16 milliseconds l Q 2 FCFS! Scheduling l 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. l 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. Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 41

42 Multilevel Feedback Queues! Processes with a CPU burst of 8 msec or less are given highest priority! Those that need more than 8 but less than 24 msec are given next highest priority! Anything longer sink to the bottom queue and are serviced only when the first two queues are idle Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 42

43 Multilevel Feedback Queues Process Burst Time P 1 42 P 2 6 P 3 20 P 4 12 P 5 32 P 6 30 P 7 10 P 8 5 Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 43

44 Real-Time Scheduling! Hard real-time systems required to complete a critical task within a guaranteed amount of time. l Resource reservation knows how much time it requires and will be scheduled if it can be guaranteed that amount of time l Requires special purpose software dedicated to their critical process! Soft real-time computing requires that critical processes receive priority over less fortunate ones. l System must have priority scheduling where real time processes are given the highest priority (no aging to keep priorities constant) l Dispatch latency must be small Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 44

45 Load balancing! Load balancing attempts to keep the workload evenly distributed across all processors in a MP system.! load balancing is typically necessary only on systems where each processor has its own private queue of eligible processes to execute.! There are two general approaches to load balancing: l push migration l pull migration! load balancing often counteracts the benefits of processor affinity, That is, the benefit of keeping a process running on the same processor (cache memory) Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 45

46 Algorithm Evaluation! Deterministic modeling takes a particular predetermined workload and defines the performance of each algorithm for that workload. l Requires too much exact knowledge, can not generalize! Queueing models l Arrival and service distributions are often unrealistic! Simulation l Distribution of jobs may not accurate; use trace tapes of real system activity l Expensive to run, time consuming; writing and testing the simulator is a major task! Implementation code the algorithm and actually evaluate it in the OS l Expensive to code and modify the OS; users unhappy with changing environment l Users take advantage of knowledge of the scheduling algorithm and run different types of programs (interactive or smaller programs given higher priority)! Best would be to be able to change the parameters used by the scheduler to reflect expected future use separation of mechanism and policy but not the common practice Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 46

47 Windows XP Priorities! Priority based,! preemptive scheduling algorithm;! highest priority always runs! Priorities are divided into two classes l Variable class 1 through 15 and l Real time class 16 through 31! Priority is based on priority class it belongs to and the relative priority within each class l When a threads quantum runs out the thread is interrupted. l If it is in the variable priority class its priority is lowered l Gives good response to interactive threads (mouse, windows) and enables I/O-bound threads to keep the I/O devices busy while compute-bound use spare CPU cycles in the background Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 47

48 Linux Scheduling! Preemptive, priority based with two separate priority ranges l Higher priority tasks have longer time quanta Silberschatz / OS Concepts / 6e - Chapter 6 CPU Scheduling Slide 48

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

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

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

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

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

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

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: 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

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: 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

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

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

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

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

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

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 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 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

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

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 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

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. 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 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

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!

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. 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

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

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

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. 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

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

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

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

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

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

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

Chapter 5: CPU Scheduling!

Chapter 5: CPU Scheduling! Chapter 5: CPU Scheduling Operating System Concepts 8 th Edition, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread 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

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 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 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

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: 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

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

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 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

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

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

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

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 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

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

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

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

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

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 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

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

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

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

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. 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

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

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

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

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

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. 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

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

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 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

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. 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

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

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

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

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

Process and Thread Scheduling. Raju Pandey Department of Computer Sciences University of California, Davis Winter 2005

Process and Thread Scheduling. Raju Pandey Department of Computer Sciences University of California, Davis Winter 2005 Process and Thread Scheduling Raju Pandey Department of Computer Sciences University of California, Davis Winter 2005 Scheduling Context switching an interrupt occurs (device completion, timer interrupt)

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

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

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 Algorithms

CPU Scheduling Algorithms CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those from the course text Operating Systems Concepts, 9th ed., by Silberschatz, Galvin, and Gagne. Many, if not

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

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

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

ICS 143 - Principles of Operating Systems

ICS 143 - Principles of Operating Systems ICS 143 - Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Note that some slides are adapted from course text slides 2008 Silberschatz. Some

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

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Department of Electr rical Eng ineering, Chapter 6: CPU Scheduling 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline Basic Concepts Scheduling Criteria Scheduling

More information

CPU Scheduling. User/Kernel Threads. Mixed User/Kernel Threads. Solaris/Linux Threads. CS 256/456 Dept. of Computer Science, University of Rochester

CPU Scheduling. User/Kernel Threads. Mixed User/Kernel Threads. Solaris/Linux Threads. CS 256/456 Dept. of Computer Science, University of Rochester CPU Scheduling CS 256/456 Dept. of Computer Science, University of Rochester User/Kernel Threads User threads Thread data structure is in user-mode memory scheduling/switching done at user mode Kernel

More information

Chapter 5 Process Scheduling

Chapter 5 Process Scheduling Chapter 5 Process Scheduling Da-Wei Chang CSIE.NCKU Source: Abraham Silberschatz, Peter B. Galvin, and Greg Gagne, "Operating System Concepts", 9th Edition, Wiley. 1 Outline Basic Concepts Scheduling Criteria

More information

Lecture 5- CPU Scheduling

Lecture 5- CPU Scheduling Lecture 5- CPU Scheduling Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 17 Lecture Outline CPU Scheduling

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

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

Threads & Introduction to CPU Scheduling

Threads & Introduction to CPU Scheduling Threads & Introduction to CPU Scheduling Mohammad S. Hasan Staffordshire University, UK Threads & Introduction to CPU Scheduling Slide 1 Lecture Outline Definition of a thread and types CPU -I/O burst

More information