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

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

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

Transcription

1 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

2 Outline 1 Chapter - 4: Threads Overview Multithreading Models Thread Libraries Threading Issues 2 Basic Concepts Scheduling Criteria Scheduling Algorithms

3 Chapter - 4: Threads Outline of Chapter - 4 Overview Multithreading Models Thread Libraries Threading Issues

4 Chapter - 4: Threads Objective To introduce the notion of a thread a fundamental unit of CPU utilization that forms the basis of multithreaded computer systems To examine issues related to multithreaded programming

5 Chapter - 4: Threads Overview Single & Multithreaded Processes

6 Chapter - 4: Threads Overview Multithreaded Server Architecture

7 Chapter - 4: Threads Overview Benefits of Multithreading Responsiveness Resource Sharing Economy Scalability

8 Chapter - 4: Threads Overview Multicore Programming Multicore systems putting pressure on programmers, challenges include Dividing activities Balance Data splitting Data dependency Testing and debugging

9 Chapter - 4: Threads Overview Concurrent execution on a single core system Vs. Parallel execution on a Multicore System Figure: Single core sequential execution

10 Chapter - 4: Threads Overview Concurrent execution on a single core system Vs. Parallel execution on a Multicore System Figure: Single core sequential execution Figure: Multicore parallel execution

11 Chapter - 4: Threads Overview User Threads Thread management done by user-level threads library Three primary thread libraries: POSIX Pthreads Win32 threads Java threads

12 Chapter - 4: Threads Overview Kernel Threads Supported by the Kernel Examples are 1 Windows XP/ Solaris 3 LINUX 4 True64 UNIX 5 Mac OS X

13 Chapter - 4: Threads Multithreading Models Multithreading Models There are different three multithreading models available: Many-to-one One-to-one Many-to-many

14 Chapter - 4: Threads Multithreading Models Many-to-one Model Many user-level threads mapped to single kernel thread Examples are 1 Solaris Green Threads 2 GNU Portable Threads

15 Chapter - 4: Threads Multithreading Models Many-to-one Model

16 Chapter - 4: Threads Multithreading Models One-to-one Model Each user-level thread maps to kernel thread Examples are 1 Windows NT/XP/ Linux 3 Solaris 9 and later

17 Chapter - 4: Threads Multithreading Models One-to-one Model

18 Chapter - 4: Threads Multithreading Models Many-to-many Model Allows many user level threads to be mapped to many kernel threads Allows the operating system to create a sufficient number of kernel threads Solaris prior to version 9 Windows NT/2000 with the ThreadFiber package

19 Chapter - 4: Threads Multithreading Models Many-to-many Model

20 Chapter - 4: Threads Multithreading Models Two level Model Similar to M:M, except that it allows a user thread to be bound to kernel thread Examples are 1 IRIX 2 HP-UX 3 True64 UNIX 4 Solaris 8 and Earlier

21 Chapter - 4: Threads Multithreading Models Two level Model

22 Chapter - 4: Threads Thread Libraries Thread Libraries Thread library provides programmer with API for creating and managing threads Two primary ways of implementing 1 Library entirely in user space 2 Kernel-level library supported by the OS

23 Chapter - 4: Threads Thread Libraries Pthreads May be provided either as user-level or kernel-level A POSIX standard (IEEE c) API for thread creation and synchronization API specifies behavior of the thread library, implementation is up to development of the library Common in UNIX operating systems (Solaris, Linux, Mac OS X)

24 Chapter - 4: Threads Thread Libraries Win32 Threads Win32 thread is a kernel-level library available on windows system Threads are created in the win32 API using the CreateThread( ) function and a set of attributes for the thread is passed to this function These attributes include security information, the size of stack, and a flag that can be set to indicate if the thread is to start in the suspended state

25 Chapter - 4: Threads Thread Libraries JAVA Threads Java threads are managed by the JVM Typically implemented using the threads model provided by underlying OS Java threads may be created by: 1 Extending Thread class 2 Implementing the Runnable interface

26 Chapter - 4: Threads Threading Issues Threading Issues Semantics of fork() and exec() system calls Thread cancelation of target thread Asynchronous or deferred Signal handling Thread pools Thread-specific data Scheduler activations

27 Chapter - 4: Threads Threading Issues Semantics of fork() and exec() Does fork() duplicate only the calling thread or all threads? UNIX system have two version of fork() One that duplicates all threads and Another that duplicates only the thread that invoked the fork() system call If a thread invokes the exec() system call, the program specified in the parameter to exec() will replace the entire process including all threads

28 Chapter - 4: Threads Threading Issues Thread Cancelation Terminating a thread before it has finished Two general approaches: 1 Asynchronous cancellation terminates the target thread immediately 2 Deferred cancellation allows the target thread to periodically check if it should be cancelled

29 Chapter - 4: Threads Threading Issues Signal Handling Signals are used in UNIX systems to notify a process that a particular event has occurred A signal handler is used to process signals 1 Signal is generated by particular event 2 Signal is delivered to a process 3 Signal is handled In multithreaded program, where should a signal be delivered? The Options are: Deliver the signal to the thread to which the signal applies Deliver the signal to every thread in the process Deliver the signal to certain threads in the process Assign a specific thread to receive all signals for the process

30 Chapter - 4: Threads Threading Issues Thread Pools In multithreading web server, whenever the server receives the thread request, it creates the separate thread to service the request The first issue is the amount of time required to create the thread prior to servicing the request, together with the fact that this thread will be discarded once it completes its assigned work Second issue is if we allow all concurrent requests to be serviced in the new thread, we have not placed a bound on the no. of threads concurrently active in the system One solution is to Create a number of threads in a pool where they await work Advantages: Usually slightly faster to service a request with an existing thread than create a new thread Allows the number of threads in the application(s) to be bound to the size of the pool

31 Chapter - 4: Threads Threading Issues Thread Specific Data Allows each thread to have its own copy of data Useful when you do not have control over the thread creation process (i.e., when using a thread pool)

32 Chapter - 4: Threads Threading Issues Scheduler Activation Both M:M and Two-level models require communication to maintain the appropriate number of kernel threads allocated to the application Scheduler activations provide upcalls - a communication mechanism from the kernel to the thread library This communication allows an application to maintain the correct number kernel threads

33 Outline of Chapter - 5 Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Algorithm Evaluation

34 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 CPU-scheduling algorithm for a particular system

35 Basic Concepts Basic Concepts Maximum CPU utilization obtained with multiprogramming CPUI/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

36 Basic Concepts Alternating Sequence of CPU And I/O Bursts

37 Basic Concepts Histogram of CPU-burst Times

38 Basic Concepts 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 (for e.g., wait for the termination of child or waiting for I/O) 2 Switches from running to ready state (for e.g., when interrupt occurs) 3 Switches from waiting to ready (for e.g., at completion of I/O) 4 Terminates Scheduling under 1 and 4 is non-preemptive or cooperative All other scheduling is preemptive

39 Basic Concepts Dispatcher Dispatcher module 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 Dispatch latency time it takes for the dispatcher to stop one process and start another running

40 Scheduling Criteria Scheduling Criteria CPU utilization keep the CPU as busy as possible Throughput per time unit No. of processes that complete their execution Turnaround time The interval from the time of submission of a process to the time of completion. Turnaround time is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O Waiting time sum of the periods a process spent 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)

41 Scheduling Criteria Scheduling Algorithm Optimization Criteria CPU utilization -

42 Scheduling Criteria Scheduling Algorithm Optimization Criteria CPU utilization - Max Throughput -

43 Scheduling Criteria Scheduling Algorithm Optimization Criteria CPU utilization - Max Throughput - Max Turnaround time -

44 Scheduling Criteria Scheduling Algorithm Optimization Criteria CPU utilization - Max Throughput - Max Turnaround time - Min Waiting time -

45 Scheduling Criteria Scheduling Algorithm Optimization Criteria CPU utilization - Max Throughput - Max Turnaround time - Min Waiting time - Min Response time -

46 Scheduling Criteria Scheduling Algorithm Optimization Criteria CPU utilization - Max Throughput - Max Turnaround time - Min Waiting time - Min Response time - Min

47 Scheduling Algorithms First-Come, First-Served (FCFS) Scheduling 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: Waiting time for P 1 = 0; P 2 = 24; P 3 = 27 Average waiting time: ( )/3 = 17

48 Scheduling Algorithms FCFS Scheduling (Con t) Suppose that the processes arrive in the order P 2, P 3, P 1 The Gantt chart for the schedule is: Waiting time for P 1 = 6; P 2 = 0; P 3 = 3 Average waiting time: ( )/3 = 3 Much better than previous case Convoy effect - short process behind long process FCFS scheduling algorithm is non-preemptive FCFS algorithm is troublesome for time-sharing systems as in time sharing system, every process should get the equal chance to get into the CPU

49 Scheduling Algorithms Shortest Job First Scheduling Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time 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

50 Scheduling Algorithms Example of SJF Process Arrival Time Burst Time P P P P SJF Scheduling Chart Average waiting time = ( ) / 4 = 7

51 Scheduling Algorithms 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 1 t n = actual length of n th CPU Burst 2 τ n+1 = predicted value for the next CPU Burst 3 α, 0 α 1 4 Define: τ n+1 = αt n + (1 α)τ n

52 Scheduling Algorithms Examples of Exponential Averaging α = 0 τ n+1 = τ n Recent history does not count α = 1 τ n+1 = αt n Only the actual last CPU burst counts If we expand the formula, we get: τ n+1 = αt n + (1 α)αt n (1 α) j αt n j (1 α) n+1 τ 0 Since both α and (1 α) are less than or equal to 1, each successive term has less weight than its predecessor

53 Scheduling Algorithms Prediction of the Length of the Next CPU Burst

54 Scheduling Algorithms Shortest Remaining Time First Scheduling (Preemptive SJF Scheduling) Process Arrival Time Burst Time P P P P SJF Scheduling Chart Average waiting time = [(10 1) + (1 1) + (17 2) + (5 3)]/4 = 26/4 = 6.5 Non-preemptive scheduling would result in an average waiting time of 7.75 milliseconds

55 Scheduling Algorithms 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) Preemptive priority scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than the priority of the currently running process Non-preemptive priority scheduling algorithm will simply put the new process at the head of the ready queue SJF is a priority scheduling where priority is the predicted next CPU burst time

56 Scheduling Algorithms Priority Scheduling Example Process Burst Time Priority P P P P P Priority scheduling chart Average waiting time is 8.2 milliseconds. Problem Starvation or indefinite blocking low priority processes may never execute Solution Aging as time progresses increase the priority of the process

57 Scheduling Algorithms Round Robin 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

58 Scheduling Algorithms Example of RR with Time Quantum = 4 Process Burst Time P 1 24 P 2 3 P 3 3 The Gantt chart is: The average waiting time is [(10-4)+4+7] / 3 = 17 / 3 = 5.66 milliseconds Typically, higher average turnaround than SJF, but better response

59 Scheduling Algorithms Round Robin Algorithm Performance 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. For example, with five processes and the time quantum of 20 milliseconds, each process will get up to 20 milliseconds after every 100 milliseconds Performance Time quantum q large FIFO Time quantum q small q must be large with respect to context switch, otherwise overhead is too high and this RR approach is called processor sharing

60 Scheduling Algorithms Time Quantum and Context Switch Time The time quantum should be large compared with the context switch time, it should not be too large If the time quantum is too large, then RR scheduling degenerates to an FCFS policy The rule of thumb is that 80 percent of the CPU bursts should be shorter than the time quantum

61 Scheduling Algorithms Turnaround Time Varies With The Time Quantum

62 Scheduling Algorithms Multilevel Queue Ready queue is partitioned into separate queues: foreground (interactive) background (batch) Foreground processes may have priority over background processes Each queue has its own scheduling algorithm foreground RR background FCFS Scheduling must be done between the queues Fixed priority 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

63 Scheduling Algorithms Multilevel Queue Scheduling

64 Scheduling Algorithms Multilevel Feedback Queue A process can move between the various queues; aging can be implemented this way If a process uses too much CPU time, it will be moved to a lower priority queue. This scheme leaves I/O bound and interactive processes in the higher priority queues. In addition, a process that waits too long in lower priority queue may be moved to the higher priority queue. Multilevel-feedback-queue scheduler defined by the following parameters: 1 number of queues 2 scheduling algorithms for each queue 3 method used to determine when to upgrade a process 4 method used to determine when to demote a process 5 method used to determine which queue a process will enter when that process needs service

65 Scheduling Algorithms 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 RR. 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 RR and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue Q 2.

66 Scheduling Algorithms Multilevel Feedback Queues

67 Scheduling Algorithms Thread Scheduling Distinction between user-level and kernel-level threads 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 is between the threads belongs to the same process Kernel thread scheduled onto available CPU is system-contention scope (SCS) competition among all threads in system PCS is done according to the priority scheduler selects the runnable thread with the highest priority to run

68 Scheduling Algorithms Pthread Scheduling API allows specifying either PCS or SCS during thread creation PTHREAD SCOPE PROCESS schedules threads using PCS scheduling PTHREAD SCOPE SYSTEM schedules threads using SCS scheduling On system implementing many-to-many model, the PTHREAD SCOPE PROCESS policy schedules user-level thread onto available LWPs. The PTHREAD SCOPE SYSTEM scheduling policy will create and bind an LWP for each user-level thread on many-tomany systems, effectively mapping threads using the one-to-one policy.

69 Scheduling Algorithms Pthread Scheduling API

70 Scheduling Algorithms Pthread Scheduling API

71 Scheduling Algorithms Multiprocessor Scheduling CPU scheduling more complex when multiple CPUs are available Homogeneous processors within a multiprocessor Asymmetric multiprocessing only one processor accesses the system data structures, reducing the need for data sharing Symmetric multiprocessing(smp) each processor is selfscheduling, all processes in common ready queue, or each has its own private queue of ready processes Processor affinity process has affinity for processor on which it is currently running 1 soft affinity OS attempts to keep the process running on the same processor but not guaranteeing that it will do so 2 hard affinity Allowing a process to specify that it is not to migrate to other processor

72 Scheduling Algorithms NUMA and CPU Scheduling

73 Scheduling Algorithms Load Balancing Load balancing attempts to keep the workload evenly distributed across all processors in SMP systems In most contemporary operating systems supporting SMP, each processor does have a private queue of eligible processes There are two general approaches to load balancing: push migration and pull migration With push migration, a specific task periodically checks the load on each processor and if it finds an imbalance evenly distributes the load by moving the processes from overloaded to idle or less busy processors Pull migration occurs when an idle processor pulls a waiting task from a busy processor

74 Scheduling Algorithms Multicore Processors Recent trend to place multiple processor cores on same physical chip Faster and consume less power Multiple threads per core also growing Takes advantage of memory stall to make progress on another thread while memory retrieve happens There are two ways to multi thread a processor Course-grained a thread executes on a processor until long latency events such as a memory stall occurs Fine-grained or interleaved multithreading switches between threads at a much finer level of granularity typically at the boundary of an instruction

75 Scheduling Algorithms Multithreaded Multicore System

76 Scheduling Algorithms Algorithm Evaluation Criteria to select an algorithm may include several measures such as Maximizing CPU utilization under the constraint that the maximum response time is 1 second Maximizing throughput such that turnaround time is linearly proportional to total execution time There are three different algorithm evaluation methods available Deterministic modeling takes a particular predetermined workload and defines the performance of each algorithm for that workload Queuing models Simulations Implementation

77 Scheduling Algorithms Deterministic Model In this method, we takes a particular predetermined workload and defines the performance of each algorithm for that workload. As for example: Process Burst Time (ms) P 1 10 P 2 29 P 3 3 P 4 7 P 5 12 Consider the FCFS, SJF, RR with q=10ms In FCFS Average waiting time: P 1, P 2, P 3, P 4, P 5 ( )/5 = 28ms

78 Scheduling Algorithms Deterministic Model (con t) With non-preemptive SJF: P 3, P 4, P 1, P 5, P 2 ( )/5 = 13ms In RR algorithm: P 1, P 2, P 3, P 4, P 5, P 2, P 5, P 2 ( )/5 = 23ms Conclusion, SJF policy is more efficient This model is simple & fast, gives exact number for comparison

79 Scheduling Algorithms Queueing Model Rather than computing average waiting time, in this model determine the distribution of CPU and I/O burst. This distribution may be measured and then approximated or simply estimated. By using several mathematical formula, describing the probability of a particular CPU burst. From this approximation, it is possible to compute average throughput, utilization, working time and so on. This area of study is also called queuing-network analysis.

80 Scheduling Algorithms Queueing Model (Con t) As an example, Let n be the average queue length (excluding process being served) W be the average waiting time in the queue. λ be the average arrival rate for the new processes in the ready queue. If the system is steady state, then number of processes leaving the queue must be equal to the number of processes that arrives, Thus... n = λ W This formula is known as Littles formula.

81 Scheduling Algorithms Evaluation of CPU schedulers by Simulation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Round Robin (RR) ACSC 271 Operating Systems. RR Example. RR Scheduling. Lecture 9: Scheduling Algorithms

Round Robin (RR) ACSC 271 Operating Systems. RR Example. RR Scheduling. Lecture 9: Scheduling Algorithms Round Robin (RR) ACSC 271 Operating Systems Lecture 9: Scheduling Algorithms Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process

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

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

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

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

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

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

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

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 CPU Scheduling 1 Outline! Basic Concepts.! Scheduling Criteria.! Scheduling Algorithms.! Multiple-Processor Scheduling.! Thread Scheduling.! Operating Systems Examples.! Algorithm

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

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput Import Settings: Base Settings: Brownstone Default Highest Answer Letter: D Multiple Keywords in Same Paragraph: No Chapter: Chapter 5 Multiple Choice 1. Which of the following is true of cooperative scheduling?

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

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

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

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

Operating System: Scheduling

Operating System: Scheduling Process Management Operating System: Scheduling OS maintains a data structure for each process called Process Control Block (PCB) Information associated with each PCB: Process state: e.g. ready, or waiting

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

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

spends most its time performing I/O How is thread scheduling different from process scheduling? What are the issues in multiple-processor scheduling?

spends most its time performing I/O How is thread scheduling different from process scheduling? What are the issues in multiple-processor scheduling? CPU Scheduling Outline What is scheduling in the OS? What are common scheduling criteria? How to evaluate scheduling algorithms? What are common scheduling algorithms? How is thread scheduling different

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 Outline

CPU Scheduling Outline CPU Scheduling Outline What is scheduling in the OS? What are common scheduling criteria? How to evaluate scheduling algorithms? What are common scheduling algorithms? How is thread scheduling different

More information

Lecture 6- CPU Scheduling Continued

Lecture 6- CPU Scheduling Continued Lecture 6- CPU Scheduling Continued Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 24 Shortest Remaining

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

Admin. Threads, CPU Scheduling. Yesterday s Lecture: Threads. Today s Lecture. ITS 225: Operating Systems. Lecture 4

Admin. Threads, CPU Scheduling. Yesterday s Lecture: Threads. Today s Lecture. ITS 225: Operating Systems. Lecture 4 ITS 225: Operating Systems Admin Lecture 4 Threads, CPU Scheduling Jan 23, 2004 Dr. Matthew Dailey Information Technology Program Sirindhorn International Institute of Technology Thammasat University Some

More information

Average waiting time = [(10-1)+(1-1)+(17-2)+(5-3)]/4 = 26/4 = 6.5 msec

Average waiting time = [(10-1)+(1-1)+(17-2)+(5-3)]/4 = 26/4 = 6.5 msec Example of Shortest-remaining-time-first i.e. Preemptive SJF Now we add the concepts of varying arrival times and preemption to the analysis ProcessAarri Arrival TimeT Burst Time P 1 0 8 P 2 1 4 P 3 2

More information

CPU Scheduling. Overview: CPU Scheduling. [SGG7/8/9] Chapter 5. Basic Concepts. CPU Scheduler. Scheduling Criteria. Optimization Criteria

CPU Scheduling. Overview: CPU Scheduling. [SGG7/8/9] Chapter 5. Basic Concepts. CPU Scheduler. Scheduling Criteria. Optimization Criteria TDDB68 Concurrent programming and operating systems CPU Scheduling Overview: CPU Scheduling CPU bursts and I/O bursts Scheduling Criteria Scheduling Algorithms Priority Inversion Problem Multiprocessor

More information

CPU Scheduling. Core Definitions

CPU Scheduling. Core Definitions CPU Scheduling General rule keep the CPU busy; an idle CPU is a wasted CPU Major source of CPU idleness: I/O (or waiting for it) Many programs have a characteristic CPU I/O burst cycle alternating phases

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

Processor Scheduling. Background. Scheduling. Scheduling

Processor Scheduling. Background. Scheduling. Scheduling Background Processor Scheduling The previous lecture introduced the basics of concurrency Processes and threads Definition, representation, management We now understand how a programmer can spawn concurrent

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

Escalonamento de Processos

Escalonamento de Processos Escalonamento de Processos SLIDES 6B Short-Term Scheduling Known as the dispatcher Executes most frequently Invoked when an event occurs Clock interrupts I/O interrupts Operating system calls Signals Scheduling

More information

4003-440/4003-713 Operating Systems I. Process Scheduling. Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu)

4003-440/4003-713 Operating Systems I. Process Scheduling. Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu) 4003-440/4003-713 Operating Systems I Process Scheduling Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu) Review: Scheduling Policy Ideally, a scheduling policy should: Be: fair, predictable

More information

Scheduling I. Introduction to scheduling. Scheduling algorithms

Scheduling I. Introduction to scheduling. Scheduling algorithms Scheduling I Introduction to scheduling Scheduling algorithms 1 Role of Dispatcher vs. Scheduler Dispatcher Low-level mechanism Responsibility: context switch Scheduler High-level policy Responsibility:

More information

CS416 CPU Scheduling

CS416 CPU Scheduling CS416 CPU Scheduling CS 416: Operating Systems Design, Spring 2011 Department of Computer Science Rutgers University Rutgers Sakai: 01:198:416 Sp11 (https://sakai.rutgers.edu) Assumptions Pool of jobs

More information

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances: Scheduling Scheduling Scheduling levels Long-term scheduling. Selects which jobs shall be allowed to enter the system. Only used in batch systems. Medium-term scheduling. Performs swapin-swapout operations

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

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

OPERATING SYSTEMS SCHEDULING

OPERATING SYSTEMS SCHEDULING OPERATING SYSTEMS SCHEDULING Jerry Breecher 5: CPU- 1 CPU What Is In This Chapter? This chapter is about how to get a process attached to a processor. It centers around efficient algorithms that perform

More information

Chapter 6: CPU Scheduling

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

More information

CS 4410 Operating Systems. CPU Scheduling. Summer 2011 Cornell University

CS 4410 Operating Systems. CPU Scheduling. Summer 2011 Cornell University CS 4410 Operating Systems CPU Scheduling Summer 2011 Cornell University Today How does CPU manage the execution of simultaneously ready processes? Example Multitasking - Scheduling Scheduling Metrics Scheduling

More information

Chapter 5: Process Scheduling

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

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline Introduction to scheduling Scheduling algorithms 1 Direction within course Until now: interrupts, processes, threads, synchronization Mostly mechanisms

More information

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run SFWR ENG 3BB4 Software Design 3 Concurrent System Design 2 SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.8 10 CPU Scheduling Chapter 11 CPU Scheduling Policies Deciding which process to run

More information

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Scheduling & Resource Utilization

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Scheduling & Resource Utilization Road Map Scheduling Dickinson College Computer Science 354 Spring 2012 Past: What an OS is, why we have them, what they do. Base hardware and support for operating systems Process Management Threads Present:

More information

COSC243 Part 2: Operating Systems

COSC243 Part 2: Operating Systems COSC243 Part 2: Operating Systems Lecture 17: CPU Scheduling Zhiyi Huang Dept. of Computer Science, University of Otago Zhiyi Huang (Otago) COSC243 Lecture 17 1 / 30 Overview Last lecture: Cooperating

More information

CPU Scheduling. Prof. Sirer (dr. Willem de Bruijn) CS 4410 Cornell University

CPU Scheduling. Prof. Sirer (dr. Willem de Bruijn) CS 4410 Cornell University CPU Scheduling Prof. Sirer (dr. Willem de Bruijn) CS 4410 Cornell University Problem You are the cook at the state st. diner customers continually enter and place their orders Dishes take varying amounts

More information

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010. Road Map Scheduling Dickinson College Computer Science 354 Spring 2010 Past: What an OS is, why we have them, what they do. Base hardware and support for operating systems Process Management Threads Present:

More information

PROCESS SCHEDULING. Operating Systems 2015 Spring by Euiseong Seo

PROCESS SCHEDULING. Operating Systems 2015 Spring by Euiseong Seo PROCESS SCHEDULING Operating Systems 2015 Spring by Euiseong Seo Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Operating Systems Examples Basic

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 Exercises 5.1 Answer: 5.2 Answer: 5.3 lottery scheduling

CHAPTER 5 Exercises 5.1 Answer: 5.2 Answer: 5.3 lottery scheduling CHAPTER 5 CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive. In this chapter, we introduce

More information

Operating Systems. Scheduling. Lecture 8 Michael O Boyle

Operating Systems. Scheduling. Lecture 8 Michael O Boyle Operating Systems Scheduling Lecture 8 Michael O Boyle 1 Scheduling We have talked about context switching an interrupt occurs (device completion, timer interrupt) a thread causes a trap or exception may

More information