Upload presentasi
Presentasi sedang didownload. Silahkan tunggu
Diterbitkan olehWidya Lesmana Telah diubah "9 tahun yang lalu
1
1 Pertemuan 6 Komunikasi antar Proses (IPC) Lanjutan Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS01
2
2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : menerangkan interprocess communication tanpa busy waiting (C2)
3
3 Outline Materi Semaphore Mutexes Monitor Message Passing
4
4 Operation DOWN and UP are Atomic Action INTERPROCESS COMMUNICATION (Cont’d) SEMAPHORES Integer variable to count the number of wakeups It is 0 if there is no wakeup, or some positive value if one or more wakeups were pending 1.DOWN (S) S = S – 1 IF (S < 0) THEN SLEEP 2.UP (S) S = S + 1 IF (S <= 0) THEN WAKEUP Two operations on semaphore: 1.DOWN (S) IF (S > 0) THEN S = S – 1 ELSE SLEEP Or alternatively
5
5 The producer-consumer problem using semaphores
6
6 Implementation of mutex_lock and mutex_unlock MUTEXES Variable that can be one of two states: unlocked or locked
7
7 MONITORS Higher level synchronization primitives A collection of procedure, variables and data structure that are all packed together into a module A monitor
8
8 Only one monitor procedure can be active at a time Buffer has N slots Producer-consumer problem using monitors
9
9 MESSAGE PASSING Two primitives: Send (destination, &message) Receive (source, &message) Design issues for message passing system Message lost Acknowledgement Domains Authentication Performance
10
10 Implementation of producer- consumer problem using message passing
11
11 Several variants of message passing: Mailbox Buffering mechanism Rendezvous No buffering mechanism
Presentasi serupa
© 2024 SlidePlayer.info Inc.
All rights reserved.