Escolar Documentos
Profissional Documentos
Cultura Documentos
Operating Systems
CPU Scheduling
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
Multi-level Feedback Queue
GMU CS 571
Basic Concepts
Interactive systems
Real-time systems
GMU CS 571
When to Schedule?
GMU CS 571
GMU CS 571
GMU CS 571
Dispatcher
switching context
switching to user mode
jumping to the proper location in the user program to restart that
program
GMU CS 571
Scheduling Criteria
Optimization Criteria
GMU CS 571
P2
P3
3
3
P2
24
P3
27
30
P3
3
P1
6
30
Non-preemptive
Preemptive Also known as the
Shortest-Remaining-Time-First (SRTF).
Process
P1
P2
P3
0.0
2.0
4.0
7
4
1
P4
5.0
SJF (non-preemptive)
P1
0
P3
7
8
P2
P4
12
16
Process
P1
P2
P3
P4
2.0
4
1
4
4.0
5.0
SJF (preemptive)
P1
0
P2
P3
2
P2
5
P4
7
P1
11
16
GMU CS 571
Priority-Based Scheduling
Preemptive
Non-preemptive
GMU CS 571
Priority Assignment
GMU CS 571
Starvation
Starvation
Its new priority may now change (as defined by its second CPU burst)!
..
GMU CS 571
Performance
q large FCFS
q small Processor Sharing (The system appears to the users as
though each of the n processes has its own processor running at
the (1/n)th of the speed of the real processor)
GMU CS 571
Process
P1
P2
P3
P4
Burst Time
53
17
68
24
GMU CS 571
GMU CS 571
GMU CS 571
Multilevel Queue
GMU CS 571
Examples
GMU CS 571
Three queues:
A new job enters the queue Q0. When it gains CPU, the job
receives 8 milliseconds. If it does not finish in 8
milliseconds, the job is moved to the queue Q1.
GMU CS 571
number of queues
Unix Scheduler
Thread Scheduling
Thread scheduling
GMU CS 571
Processor Affinity
Load Balancing
Trade-offs
GMU CS 571
Solaris 9 Scheduling
GMU CS 571
GMU CS 571
Linux Scheduling
GMU CS 571
Scheduling Summary