Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 21: Introduction to Process Scheduling

Similar presentations


Presentation on theme: "Lecture 21: Introduction to Process Scheduling"— Presentation transcript:

1 Lecture 21: Introduction to Process Scheduling

2 Review: Processes & Threads
Resource ownership – Process or Task Scheduling/execution – Thread or lightweight process One process, one thread (MS-DOS) One process, multiple threads (Java Runtime) Multiple processes, one thread per process (Unix) Multiple processes, multiple threads (W2K, Solaris, Linux)

3 Review: Single Threaded and Multithreaded Process Models

4 Review: Process/Thread States
Possible process states running blocked ready

5 Process behavior Different Types of jobs have different demands
a CPU-bound process an I/O bound process

6 Process Scheduling When to run a different process? Which one to run?

7 When to schedule process
New process is created Process terminates A process blocks on I/O, semaphore, etc. I/O interrupt occurs Hardware clock interrupts

8 Preemptive vs. Non-preemptive
Non-preemptive Scheduling: Processes run until they have finished or block for I/O Preemptive Scheduling: Can forcibly suspend a process and switch to another Hardware Clock Interrupt helps in implementing preemption

9 Categories of Process Scheduling
Batch Systems (Compute Servers) Many processes, not interactive, throughput is important Interactive Systems PC Real Time Systems Guaranteed response times, meet deadlines

10 Scheduling Algorithm Goals
All Systems Fairness – giving each process a fair share of the CPU Policy enforcement – seeing that stated policy is carried out Balance – keeping all parts of the system busy

11 Scheduling Algorithm Goals
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 Scheduling Algorithm Goals
Interactive Systems Response time – respond to requests quickly Proportionality – meet users’ expectations

13 Scheduling Algorithm Goals
Real-time Systems Meeting deadlines – avoid losing data Predictability – avoid quality degradation in multimedia systems

14 First Come First Serve (FCFS)
Maintain queue of processes Schedule first in queue Scheduled job executes until it finishes or blocks for I/O Simple, easy to implement Not good for mix of short and long jobs Example: a short job arriving soon after a long one

15 FCFS Arrival time CPU burst P1: 4 36 8 112 1 13 I/O burst 16
13 16 20 P1: I/O burst P2: P3: P4:

16 FCFS 13 16 20 P1: P2: P3: P4: Which process goes next? P1 idle P2 P3 P4

17 FCFS Time next ready 40 76 60 192 13 16 20 P1: P2: P3: P4: Which process goes next? P1 idle P2 P3 P4


Download ppt "Lecture 21: Introduction to Process Scheduling"

Similar presentations


Ads by Google