Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,
|
|
- Melvin Jacobs
- 5 years ago
- Views:
Transcription
1 Chapter 5: CPU Scheduling Operating System Concepts 8 th Edition, Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
2 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm Evaluation 2/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
3 Objectives To introduce process scheduling, which is the basis for multiprogrammed operating systems To describe various process-scheduling algorithms To discuss evaluation criteria for selecting a process-scheduling algorithm for a particular system 3/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
4 Basic Concepts CPU Burst : Time it takes for the CPU to execute an operation I/O Burst : Time it takes for the CPU to wait for I/O task Goal of processor scheduling : 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 4/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
5 CPU burst vs. IO burst (a) A CPU-bound process (b) An I/O-bound process 5/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim
6 Histogram of CPU-burst Times 6/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
7 Alternating Sequence of CPU And I/O Bursts 7/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
8 CPU Scheduler Selects a process (in ready queue) 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 -I/O request, event wait, completion of child process 2. Switches from running to ready state interrupt request 3. Switches from waiting to ready completion of I/O task or event 4. Terminates Scheduling under 1 and 4 is nonpreemptive All other scheduling (2 and 3) is preemptive - OS 가우선적으로중단 / 실행 8/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
9 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 9/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
10 Scheduling Criteria CPU utilization keep the CPU as busy as possible Throughput # of processes that complete their execution per time unit Turnaround time amount of time to execute a particular process 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 timesharing environment) 10/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
11 Scheduling Algorithm Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time 11/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
12 Scheduling Goals All systems Fairness: giving each process a fair share of the CPU Balance: keeping all parts of the system busy Batch systems Throughput: maximize jobs per hour Turnaround time: minimize time between submission and termination CPU utilization: keep the CPU busy all the time 12/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
13 Scheduling Goals (Cont d) Interactive systems Response time: minimize average time spent on ready queue Waiting time: minimize average time spent on wait queue Proportionality: meet users expectations Real-time systems Meeting deadlines: avoid losing data Predictability: avoid quality degradation in multimedia systems 13/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
14 Scheduling Non-goals Starvation(of process) A situation where a process is prevented from making progress because another process has the resource it requires. Resource could be the CPU or a lock A poor scheduling policy can cause starvation If a high-priority process always prevents a low-priority process from running on the CPU Synchronization can also cause starvation One thread always beats another when acquiring a lock Constant supply of readers always blocks out writers 14/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
15 First-Come, First-Served (FCFS) Scheduling First-Come, First-Served Jobs are scheduled in order that they arrive Real-world scheduling of people in lines e.g. supermarket, bank tellers, McDonalds, etc. Typically, non-preemptive Jobs are treated equally: no starvation Problems Average waiting time can be large if small jobs wait behind long ones Basket vs. cart May lead to poor overlap of I/O and CPU 15/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
16 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: P 1 P 2 P Waiting time for P 1 = 0; P 2 = 24; P 3 = 27 Average waiting time: ( )/3 = 17 16/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
17 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 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 17/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
18 SJF Shortest Job First Choose the job with the smallest expected CPU burst Can prove that SJF has optimal min. average waiting time Only when all jobs are available simultaneously Non-preemptive Problems Impossible to know size of future CPU burst Can you make a reasonable guess? Can potentially starve 18/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
19 Shortest-Job-First (SJF) Scheduling Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time Two schemes of SJF: Nonpreemptive Once CPU given to the process it cannot be preempted until completes its CPU burst Preemptive If a new process arrives with CPU burst length less than remaining time of current executing process, preempt This scheme is known as the Shortest-Remaining-Time-First (SRTF) 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 19/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
20 Example of Non-Preemptive SJF Process Arrival Time Burst Time P P P P SJF (non-preemptive) Average waiting time = ( )/4 = 4 P1 0=0-0 P2:8-2.0=6 P3:7-4.0=3 P4:12-5.0=7 0: P1(7) =>P1(7) p1(7) ~ 7:P2(4),P3(1),P4(4) => P3(1) p3(1) ~ 8: P2(4),P4(4) =>P2(4) p2(4) ~ 12:P4(4)=>P4(4) p4(4) ~ /54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
21 Example of Preemptive SJF Process Arrival Time Burst Time P P P P SJF (preemptive) (= SRTF) Average waiting time = ( )/4 = 3 P1: =9 P2: =1 P3=4-4.0=0 P4:7-5=2 0 : P1(7) =P1(7) P1(7) ~ 2.0 p2(4) : P1(5), p2(4) => p2(4) P2(4) ~ 4.0 p3(1) : p1(5), p2(2), p3(1) => p3(1) P3(1) ~ 5.0 p4(4) : p1(5),p2(2), p4(4) =>P2(2) P2(2) ~ 7.0 : p1(5),p4(4) =>P4(4) p4(4) ~ 11.0 : P1(5) =>P1(5) p1(5) ~ 16.0 : 21/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
22 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 length of n n 1, 0 1 Define : CPU burst predicted value for the next CPU th 1. n 1 tn n burst 22/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
23 Prediction of the Length of the Next CPU Burst 10, 0.5, t 0 t t 1 t *6 0.5* *4 0.5* *6 0.5* /54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim
24 Examples of Exponential Averaging =0 =1 n+1 = n Recent history does not count 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 24/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
25 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 nonpreemptive 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 25/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
26 Priority Scheduling Abstractly modeled as multiple priority queues Put ready job on Queue associated with its priority 26/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
27 Round Robin (RR) For time sharing system. FCFS, each process occupies for quantum at a time, preemptive scheduling, circular ready queue 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 q large FIFO q small q must be large with respect to context switch, otherwise overhead is too high 27/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
28 Example of RR with Time Quantum = 4 Process Burst Time P 1 24 P 2 3 P 3 3 The Gantt chart is: P 1 P 2 P 3 P 1 P 1 P 1 P 1 P Typically, higher average turnaround than SJF, but better response queue : p1(24),p2(3),p3(3) 0 : p1(24) : p2(3),p3(3) timer 4:p2(3) : p3(3),p1(20) release 7 : p3(3) : p1(20), release 10:p1(20) : timer 14:p1(16): timer 18:p1(12): timer 22:p1(8): timer 26:p1(4): timer 30: 28/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
29 Time Quantum and Context Switch Time 29/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
30 Turnaround Time Varies With The Time Quantum 30/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
31 Problems of RR What do you set the quantum to be? quantum -> : FIFO quantum -> 0 : processor sharing If small, then context switches are frequent incurring high overhead (CPU utilization drops) If large, then response time drops A rule of thumb: 80% of the CPU bursts should be shorter than the time quantum 31/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
32 Multilevel Queue Ready queue is partitioned into separate queues: foreground (interactive) background (batch) 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 32/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
33 Multilevel Queue Scheduling 33/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
34 Multilevel Feedback Queue In multilevel queue scheduling algorithm, processors are permanently assigned to a queue In multilevel feedback queue scheduling algorithm, a process can move between the various queues; aging can be implemented this way Multilevel-feedback-queue scheduler defined by the following parameters: number of queues scheduling algorithms for each queue method used to determine when to upgrade a process method used to determine when to demote a process method used to determine which queue a process will enter when that process needs service 34/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
35 Example of Multilevel Feedback Queue Scheduler Three queues: Q 0 RR with time quantum 8 milliseconds Q 1 RR time quantum 16 milliseconds Q 2 FCFS Scheduling A new job enters queue Q 0 which is served FCFS. When it gains CPU, job receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to queue Q 1. At Q 1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue Q 2. 35/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
36 Multilevel Feedback Queues 36/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
37 Thread Scheduling Thread scheduling for the user level thread Scheduled by a thread library. Must ultimately be mapped indirectly to a associated kernel thread on many-to-one and many-to-many models The thread library schedules user-level threads to run on LWP(Light Weight Process), a scheme known as process-contention scope (PCS) since competition for CPU takes place among threads belonging to the same process. Thread scheduling for the kernel thread Scheduled by OS scheduled onto available CPU is system-contention scope (SCS) competition among all threads in system 37/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
38 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. 38/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
39 Pthread Scheduling API for POSIX #include <pthread.h> #include <stdio.h> #define NUM THREADS 5 int main(int argc, char *argv[]) { int I, scope; pthread_t tid[num THREADS]; pthread_attr_t attr; /* get the default attributes */ pthread_attr_init(&attr); /* first inquire on the current scope */ if (pthread_attr_getscope(&attr, &scope)!= 0) printf(stderr, Unable to get scheduling scope\n ); else { if (scope == PTHREAD_SCOPE_PROCESS) pritnf( PTHREAD_SCOPE_PROCESS ); else if (scope == PTHREAD_SCOPE_SYSTEM) pritnf( PTHREAD_SCOPE_SYSTEM ); else printf(stderr, Illegal scope value.\n ); } 39/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
40 Pthread Scheduling API /* set the scheduling algorithm to PCS(PROCESS) or (SCS)SYSTEM */ pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); /* set the scheduling policy - FIFO, RT, or OTHER pthread_attr_setschedpolicy(&attr, SCHED OTHER); */ /* create the threads */ for (i = 0; i < NUM_THREADS; i++) pthread_create(&tid[i],&attr,runner,null); /* now join on each thread */ for (i = 0; i < NUM THREADS; i++) pthread_join(tid[i], NULL); } /* Each thread will begin control in this function */ void *runner(void *param) { } /* do some work */ printf("i am a thread\n"); pthread exit(0); 40/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
41 Multiple-Processor Scheduling CPU scheduling more complex when multiple CPUs are available=> load sharing cover only Homogeneous processors within a multiprocessor Asymmetric multiprocessing A single process(master server) handle all scheduling decision, I/O processing, other system activities, and accesses the system data structures, alleviating the need for data sharing Symmetric multiprocessing (SMP) each processor is self-scheduling, all processes may be 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 soft affinity when a process is able to migrate between processors. hard affinity when a process is not allowed to migrate between processors. 41/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
42 Multiple-Processor Scheduling Symmetric multithreading(smt) Hyperthreading technology in Intel company OS offers logical processor to each thread 42/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
43 Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling 43/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
44 Solaris Scheduling 44/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
45 Solaris Dispatch Table for time-sharing and interactive threads Low (ms) high 45/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
46 Windows XP Priorities Priority of process priority classes : real-time, high, above normal, Relative priority of process thread of a given priority class Relative priorities : time-critical, highest 46/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
47 Linux Scheduling Constant order O(1) scheduling time Two priority ranges: time-sharing and real-time Real-time range from 0 to 99 and nice value from 100 to 140 (figure 5.15) 47/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
48 Priorities and Time-slice length 48/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
49 List of Tasks Indexed According to Priorities 49/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
50 Algorithm Evaluation Examples of criteria to select algorithm Maximizing CPU utilization under the constraint that the maximum response time is 1 second. Maximizing throughput such that turnaround time is (on average) linearly proportional to total execution time. 50/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
51 Evaluation Methods of scheduling algorithm Deterministic modeling Takes a particular predetermined workload and defines the performance of each algorithm for that workload Queueing models Mathematical models used to compute expected system parameters Simulation Algorithmic models which simulate a simplified version of a system using statistical input Trace tape (or trace data) Implementation Direct implementation of the system under test, with appropriate benchmarks 51/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
52 Deterministic modeling Process : p1 p2 p3 p4 p5 Burst time(ms) : FCFS scheduling algorithm Averaging waiting time : ( )/5 = 28 ms SJF scheduling algorithm Averaging waiting time : ( )/5=13 ms 52/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
53 Deterministic modeling Process : p1 p2 p3 p4 p5 Burst time(ms) : RR at time quantum = 10ms Averaging waiting time : ( )/5 = 23 ms p1 : 0 p2 : =32 p3 : 20 p4 : 23 p5 : 30+10=40 53/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
54 Evaluation of CPU schedulers by Simulation 54/54 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
55 End of Chapter 5 Operating System Concepts 8 th Edition, Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009
Chapter 5 CPU scheduling
Chapter 5 CPU scheduling Contents Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling
More informationCPU 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 informationChapter 5: Process Scheduling
Chapter 5: Process Scheduling Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Thread Scheduling Operating Systems Examples Algorithm
More informationChapter 5: CPU Scheduling. Operating System Concepts Essentials 8 th Edition
Chapter 5: CPU Scheduling Silberschatz, Galvin and Gagne 2011 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating
More informationChapter 5: CPU Scheduling
Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm Evaluation
More informationCS307: Operating Systems
CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn
More informationChapter 5: CPU Scheduling
COP 4610: Introduction to Operating Systems (Fall 2016) Chapter 5: CPU Scheduling Zhi Wang Florida State University Contents Basic concepts Scheduling criteria Scheduling algorithms Thread scheduling Multiple-processor
More informationCSE 4/521 Introduction to Operating Systems
CSE 4/521 Introduction to Operating Systems Lecture 9 CPU Scheduling II (Scheduling Algorithms, Thread Scheduling, Real-time CPU Scheduling) Summer 2018 Overview Objective: 1. To describe priority scheduling
More informationChapter 6: CPU Scheduling
Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne Histogram of CPU-burst Times 6.2 Silberschatz, Galvin and Gagne Alternating Sequence of CPU And I/O Bursts 6.3 Silberschatz, Galvin and Gagne CPU
More informationChapter 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 informationOperating Systems CS 323 Ms. Ines Abbes
Taibah University College of Community of Badr Computer Science Department Operating Systems CS71/CS72 جامعة طيبة كلية المجتمع ببدر قسم علوم الحاسب مقرر: نظم التشغيل Operating Systems CS 323 Ms. Ines Abbes
More informationJob Scheduling. CS170 Fall 2018
Job Scheduling CS170 Fall 2018 What to Learn? Algorithms of job scheduling, which maximizes CPU utilization obtained with multiprogramming Select from ready processes and allocates the CPU to one of them
More informationChapter 6: CPU Scheduling. Operating System Concepts 9 th Edition
Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various CPU-scheduling algorithms
More informationChapter 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 informationChapter 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 informationChapter 6: CPU Scheduling
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 informationScheduling. Today. Next Time Process interaction & communication
Scheduling Today Introduction to scheduling Classical algorithms Thread scheduling Evaluating scheduling OS example Next Time Process interaction & communication Scheduling Problem Several ready processes
More informationChapter 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 informationChapter 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 informationCPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University
Operating Systems (Fall/Winter 2018) CPU Scheduling Yajin Zhou (http://yajin.org) Zhejiang University Acknowledgement: some pages are based on the slides from Zhi Wang(fsu). Review Motivation to use threads
More informationRound 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 informationChapter 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 informationChapter 5: CPU Scheduling
Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm Evaluation Chapter 5: CPU Scheduling
More informationChapter 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 informationChapter 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 informationProperties of Processes
CPU Scheduling Properties of Processes CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution: CPU Scheduler Selects from among the processes that
More informationCHAPTER 2: PROCESS MANAGEMENT
1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:
More informationChapter 5 Scheduling
Chapter 5 Scheduling Images from Silberschatz Pacific University 1 Life time of a single process CPU usage/io bursts What would an IO bound process look like? What would a CPU bound process look like?
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 10 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Chapter 6: CPU Scheduling Basic Concepts
More informationCPU Scheduling: Objectives
CPU Scheduling: Objectives CPU scheduling, the basis for multiprogrammed operating systems CPU-scheduling algorithms Evaluation criteria for selecting a CPU-scheduling algorithm for a particular system
More informationLECTURE 3:CPU SCHEDULING
LECTURE 3:CPU SCHEDULING 1 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time CPU Scheduling Operating Systems Examples Algorithm Evaluation 2 Objectives
More informationCPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)
CPU Scheduling Daniel Mosse (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013) Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process
More informationCPU Scheduling Algorithms
CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts with Java, by Silberschatz, Galvin, and Gagne (2007).
More informationLecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms
Operating System Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts Scheduling Criteria Scheduling Algorithms OS Process Review Multicore Programming Multithreading Models Thread Libraries Implicit
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2019 Lecture 8 Scheduling Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ POSIX: Portable Operating
More informationCPU Scheduling (Part II)
CPU Scheduling (Part II) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) CPU Scheduling 1393/7/28 1 / 58 Motivation Amir H. Payberah
More informationCS3733: Operating Systems
CS3733: Operating Systems Topics: Process (CPU) Scheduling (SGG 5.1-5.3, 6.7 and web notes) Instructor: Dr. Dakai Zhu 1 Updates and Q&A Homework-02: late submission allowed until Friday!! Submit on Blackboard
More informationLecture 2 Process Management
Lecture 2 Process Management Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks The terms job and process may be interchangeable
More informationOPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5
OPERATING SYSTEMS CS3502 Spring 2018 Processor Scheduling Chapter 5 Goals of Processor Scheduling Scheduling is the sharing of the CPU among the processes in the ready queue The critical activities are:
More informationProcess Concept Process in Memory Process State new running waiting ready terminated Diagram of Process State
Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks Textbook uses the terms job and process almost interchangeably Process a
More informationOPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:
OPERATING SYSTEMS UNIT II Sections A, B & D PREPARED BY ANIL KUMAR PRATHIPATI, ASST. PROF., DEPARTMENT OF CSE. PROCESS CONCEPT An operating system executes a variety of programs: Batch system jobs Time-shared
More informationChapter 5: CPU Scheduling. Operating System Concepts 9 th Edit9on
Chapter 5: CPU Scheduling Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Thread
More informationProcess- Concept &Process Scheduling OPERATING SYSTEMS
OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne PROCESS MANAGEMENT Current day computer systems allow multiple
More informationCPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )
CPU Scheduling CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections 6.7.2 6.8) 1 Contents Why Scheduling? Basic Concepts of Scheduling Scheduling Criteria A Basic Scheduling
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 8 Threads and Scheduling Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How many threads
More informationCPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science
CPU Scheduling Rab Nawaz Jadoon DCS COMSATS Institute of Information Technology Assistant Professor COMSATS, Lahore Pakistan Operating System Concepts Objectives To introduce CPU scheduling, which is the
More informationComputer Systems Laboratory Sungkyunkwan University
CPU Scheduling Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics General scheduling concepts Scheduling algorithms Case studies Linux
More informationCISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College
CISC 7310X C05: CPU Scheduling Hui Chen Department of Computer & Information Science CUNY Brooklyn College 3/1/2018 CUNY Brooklyn College 1 Outline Recap & issues CPU Scheduling Concepts Goals and criteria
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 9 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 CPU Scheduling: Objectives CPU scheduling,
More informationTitolo presentazione. Scheduling. sottotitolo A.Y Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella
Titolo presentazione Scheduling sottotitolo A.Y. 2017-18 Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella Process Scheduling Goals: Multiprogramming: having some process running at all times,
More informationALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.
Midterm Exam Reviews ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Particular attentions on the following: System call, system kernel Thread/process, thread vs process
More informationUniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling
Uniprocessor Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Three level scheduling 2 1 Types of Scheduling 3 Long- and Medium-Term Schedulers Long-term scheduler Determines which programs
More informationLast class: Today: CPU Scheduling. CPU Scheduling Algorithms and Systems
1 Last class: CPU Scheduling Today: CPU Scheduling Algorithms and Systems 2 Scheduling Algorithms First-come, First-serve (FCFS) Non-preemptive Does not account for waiting time (or much else) Convoy problem
More informationPractice Exercises 305
Practice Exercises 305 The FCFS algorithm is nonpreemptive; the RR algorithm is preemptive. The SJF and priority algorithms may be either preemptive or nonpreemptive. Multilevel queue algorithms allow
More informationScheduling. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Process interaction & communication
Scheduling Today! Introduction to scheduling! Classical algorithms Next Time! Process interaction & communication Scheduling! Problem Several ready processes and threads & much fewer CPUs! A choice has
More informationCPU Scheduling: Part I ( 5, SGG) Operating Systems. Autumn CS4023
Operating Systems Autumn 2017-2018 Outline 1 CPU Scheduling: Part I ( 5, SGG) Outline CPU Scheduling: Part I ( 5, SGG) 1 CPU Scheduling: Part I ( 5, SGG) Basic Concepts Typical program behaviour CPU Scheduling:
More informationCSE 120 Principles of Operating Systems Spring 2017
CSE 120 Principles of Operating Systems Spring 2017 Lecture 5: Scheduling Administrivia Homework #1 due tomorrow Homework #2 out tomorrow October 20, 2015 CSE 120 Lecture 8 Scheduling and Deadlock 2 Scheduling
More informationTDIU25: Operating Systems II. Processes, Threads and Scheduling
TDIU25: Operating Systems II. Processes, Threads and Scheduling SGG9: 3.1-3.3, 4.1-4.3, 5.1-5.4 o Process concept: context switch, scheduling queues, creation o Multithreaded programming o Process scheduling
More informationOperating System Concepts Ch. 5: Scheduling
Operating System Concepts Ch. 5: Scheduling Silberschatz, Galvin & Gagne Scheduling In a multi-programmed system, multiple processes may be loaded into memory at the same time. We need a procedure, or
More informationOperating Systems Unit 3
Unit 3 CPU Scheduling Algorithms Structure 3.1 Introduction Objectives 3.2 Basic Concepts of Scheduling. CPU-I/O Burst Cycle. CPU Scheduler. Preemptive/non preemptive scheduling. Dispatcher Scheduling
More informationCSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling
CSE120 Principles of Operating Systems Prof Yuanyuan (YY) Zhou Scheduling Announcement l Homework 2 due on October 26th l Project 1 due on October 27th 2 Scheduling Overview l In discussing process management
More informationCPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:
CPU Scheduling (Topic 3) 홍성수 서울대학교공과대학전기공학부 Real-Time Operating Systems Laboratory CPU Scheduling (1) Resources fall into two classes: Preemptible: Can take resource away, use it for something else, then
More informationCh 4 : CPU scheduling
Ch 4 : CPU scheduling It's the basis of multiprogramming operating systems. By switching the CPU among processes, the operating system can make the computer more productive In a single-processor system,
More informationCPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)
1/32 CPU Scheduling The scheduling problem: - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s) When do we make decision? 2/32 CPU Scheduling Scheduling decisions may take
More informationScheduling in the Supermarket
Scheduling in the Supermarket Consider a line of people waiting in front of the checkout in the grocery store. In what order should the cashier process their purchases? Scheduling Criteria CPU utilization
More informationSo far. Next: scheduling next process from Wait to Run. 1/31/08 CSE 30341: Operating Systems Principles
So far. Firmware identifies hardware devices present OS bootstrap process: uses the list created by firmware and loads driver modules for each detected hardware. Initializes internal data structures (PCB,
More informationLast Class: Processes
Last Class: Processes A process is the unit of execution. Processes are represented as Process Control Blocks in the OS PCBs contain process state, scheduling and memory management information, etc A process
More informationCSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.
CSC 4103 - Operating Systems Spring 2008 Lecture - XII Midterm Review Tevfik Ko!ar Louisiana State University March 4 th, 2008 1 I/O Structure After I/O starts, control returns to user program only upon
More informationOperating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni
Operating Systems Lecture 2.2 - Process Scheduling Golestan University Hossein Momeni momeni@iust.ac.ir Scheduling What is scheduling? Goals Mechanisms Scheduling on batch systems Scheduling on interactive
More informationMaximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait
Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling Algorithm Evaluation CPU
More informationProcesses and Threads
Processes and Threads Giuseppe Anastasi g.anastasi@iet.unipi.it Pervasive Computing & Networking Lab. () Dept. of Information Engineering, University of Pisa Based on original slides by Silberschatz, Galvin
More informationECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads
ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Processes and threads 1 Overview Process concept Process scheduling Thread
More informationby Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science
by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science Table of Contents 1. Introduction...1 2. CPU Scheduling Overview...1 3. Processes
More informationCPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)
CPU Scheduling The scheduling problem: - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s) When do we make decision? 1 / 31 CPU Scheduling new admitted interrupt exit terminated
More informationOperating Systems ECE344. Ding Yuan
Operating Systems ECE344 Ding Yuan Announcement & Reminder Midterm exam Will grade them this Friday Will post the solution online before next lecture Will briefly go over the common mistakes next Monday
More informationAssignment 3 (Due date: Thursday, 10/15/2009, in class) Part One: Provide brief answers to the following Chapter Exercises questions:
Assignment 3 (Due date: Thursday, 10/15/2009, in class) Your name: Date: Part One: Provide brief answers to the following Chapter Exercises questions: 4.7 Provide two programming examples in which multithreading
More informationProcesses. CS 475, Spring 2018 Concurrent & Distributed Systems
Processes CS 475, Spring 2018 Concurrent & Distributed Systems Review: Abstractions 2 Review: Concurrency & Parallelism 4 different things: T1 T2 T3 T4 Concurrency: (1 processor) Time T1 T2 T3 T4 T1 T1
More informationChap 7, 8: Scheduling. Dongkun Shin, SKKU
Chap 7, 8: Scheduling 1 Introduction Multiprogramming Multiple processes in the system with one or more processors Increases processor utilization by organizing processes so that the processor always has
More informationCOSC243 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 informationLecture 17: Threads and Scheduling. Thursday, 05 Nov 2009
CS211: Programming and Operating Systems Lecture 17: Threads and Scheduling Thursday, 05 Nov 2009 CS211 Lecture 17: Threads and Scheduling 1/22 Today 1 Introduction to threads Advantages of threads 2 User
More informationScheduling of processes
Scheduling of processes Processor scheduling Schedule processes on the processor to meet system objectives System objectives: Assigned processes to be executed by the processor Response time Throughput
More information3. CPU Scheduling. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn
3. CPU Scheduling Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn S P O I L E R operating system CPU Scheduling 3 operating system CPU Scheduling 4 Long-short-medium Scheduler
More informationAnnouncements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.
Program #1 Announcements Is due at 9:00 AM on Thursday Program #0 Re-grade requests are due by Monday at 11:59:59 PM Reading Chapter 6 1 CPU Scheduling Manage CPU to achieve several objectives: maximize
More informationCourse Syllabus. Operating Systems
Course Syllabus. Introduction - History; Views; Concepts; Structure 2. Process Management - Processes; State + Resources; Threads; Unix implementation of Processes 3. Scheduling Paradigms; Unix; Modeling
More informationCS 318 Principles of Operating Systems
CS 318 Principles of Operating Systems Fall 2018 Lecture 4: Scheduling Ryan Huang Slides adapted from David Mazières lectures Administrivia Lab 0 Due today Submit in Blackboard Lab 1 released Due in two
More informationPreview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System
Preview Process Scheduler Short Term Scheduler Long Term Scheduler Process Scheduling Algorithms for Batch System First Come First Serve Shortest Job First Shortest Remaining Job First Process Scheduling
More informationOperating Systems. Scheduling
Operating Systems Scheduling Process States Blocking operation Running Exit Terminated (initiate I/O, down on semaphore, etc.) Waiting Preempted Picked by scheduler Event arrived (I/O complete, semaphore
More informationUnit 3 : Process Management
Unit : Process Management Processes are the most widely used units of computation in programming and systems, although object and threads are becoming more prominent in contemporary systems. Process management
More informationCPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS
Schedulers in the OS Scheduling Structure of a Scheduler Scheduling = Selection + Dispatching Criteria for scheduling Scheduling Algorithms FIFO/FCFS SPF / SRTF Priority - Based Schedulers start long-term
More informationCSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo
CSE 120 Principles of Operating Systems Fall 2007 Lecture 8: Scheduling and Deadlock Keith Marzullo Aministrivia Homework 2 due now Next lecture: midterm review Next Tuesday: midterm 2 Scheduling Overview
More informationScheduling. Multi-processing. Process Characterization. time. ...makes use of idle. COS450-F18-05-Scheduling - October 8, 2018
1 Scheduling Process Management COS 450 - Fall 2018 Process Characterization 2 Px - 10µS CPU IO CPU IO CPU IO CPU IO CPU CPU IO CPU IO CPU IO CPU...mix...many of processing of these are and in the idle
More informationSupplementary Materials on Multilevel Feedback Queue
Supplementary Materials on Multilevel Feedback Queue Review Each job runs for the same amount of time. All jobs arrive at the same time. Once started, each job runs to completion. Performance is more important.
More informationCS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University
Frequently asked questions from the previous class survey CS 370: SYSTEM ARCHITECTURE & SOFTWARE [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University OpenMP compiler directives
More informationStart of Lecture: February 10, Chapter 6: Scheduling
Start of Lecture: February 10, 2014 1 Reminders Exercise 2 due this Wednesday before class Any questions or comments? 2 Scheduling so far First-Come-First Serve FIFO scheduling in queue without preempting
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Fall 2016 Lecture 8: Scheduling and Deadlock Geoffrey M. Voelker Administrivia Thursday Friday Monday Homework #2 due at start of class Review material for midterm
More informationFrequently asked questions from the previous class survey
CS 370: OPERATING SYSTEMS [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University L14.1 Frequently asked questions from the previous class survey Turnstiles: Queue for threads blocked
More informationCPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31
CPU scheduling 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 a single-processor
More informationScheduling. The Basics
The Basics refers to a set of policies and mechanisms to control the order of work to be performed by a computer system. Of all the resources in a computer system that are scheduled before use, the CPU
More informationCSCE Operating Systems Scheduling. Qiang Zeng, Ph.D. Fall 2018
CSCE 311 - Operating Systems Scheduling Qiang Zeng, Ph.D. Fall 2018 Resource Allocation Graph describing the traffic jam CSCE 311 - Operating Systems 2 Conditions for Deadlock Mutual Exclusion Hold-and-Wait
More informationOperating System Review Part
Operating System Review Part CMSC 602 Operating Systems Ju Wang, 2003 Fall Virginia Commonwealth University Review Outline Definition Memory Management Objective Paging Scheme Virtual Memory System and
More information