download

Matakuliah
Tahun
Versi/Revisi
: T0316/sistem Operasi
: 2005
:5
Pertemuan 7
Masalah-masalah pada
Komunikasi antar Proses
dan
Penjadwalan Batch
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• mendemonstrasikan masalah klasik dalam
komunikasi antar proses dan
mendemonstrasikan penjadwalan proses pada
sistem batch (C3)
2
Outline Materi
Classical IPC Problems
– Dining Philosophers problem
– The Reader and Writers problem
– The Sleeping Barber problem
Batch Scheduling
–
–
–
–
FCFS
Shortest Job First
Shortest Remaining Time Next
Three-Level Scheduling
3
Classical IPC problems
4
Dining Philosophers (1)
•
•
•
•
Philosophers eat/think
Eating needs 2 forks
Pick one fork at a time
How to prevent
deadlock
5
Dining Philosophers (2)
A non-solution to the dining philosophers
problem
6
Dining Philosophers (3)
Solution to dining philosophers problem (part 1)
7
Dining Philosophers (4)
Solution to dining philosophers problem (part 2)
8
The Readers and Writers Problem
A solution to the
readers and writers
problem
9
The Sleeping Barber Problem (1)
10
The Sleeping Barber Problem (2)
Solution to sleeping barber
problem.
11
Scheduling
12
Introduction to Scheduling (1)
• Bursts of CPU usage alternate with periods of I/O
wait
– a CPU-bound process
– an I/O bound process
13
Introduction to Scheduling (2)
Scheduling Algorithm Goals
14
Scheduling in Batch Systems (1)
First-Come First-Serve
Processes are assigned the CPU in the order they request it
Adv:
Easy to understand and easy to program
Disadv:
Short job may wait too long if long job is in front of it
15
Scheduling in Batch Systems (2)
Shortest job first scheduling
• Only optimal when all jobs are available simultaneously
 the run time must be known in advance
Shortest remaining time next
• The scheduler always chooses the process whose
remaining run time is the shortest
 the run time must be known in advance
16
Scheduling in Batch Systems (3)
Three level scheduling
17