INTERPROCESS COMMUNICATION (LANJUTAN) T0542 / 05 - 01 SEMAPHORES • Integer variable untuk menghitung jumlah wakeup • Bernilai negatif bila ada permintaan yang tidak bisa dipenuhi, bernilai positif bila ada wakeup (resource available) Dua macam operasi terhadap semaphore: 1. DOWN (S) S=S–1 IF (S < 0) THEN SLEEP(S) 2. UP (S) S=S+1 IF (S <= 0) THEN WAKEUP(S) Operasi DOWN dan UP merupakan operasi yang bersifat Atomic (Atomic Action) T0542 / 05 - 02 The producerconsumer problem using semaphores T0542 / 05 - 03 MUTEXES • Variable yang bernilai salah satu dari dua keadaan: unlocked atau locked Implementation of mutex_lock and mutex_unlock T0542 / 05 - 04 MONITORS • Higher level synchronization primitives • Kumpulan prosedur, variable dan data struktur yang dikelompokkan menjadi suatu modul Contoh suatu monitor T0542 / 05 - 05 Producer-consumer problem menggunakan monitors • Hanya satu prosedur monitor yang aktif dalam suatu waktu • Buffer memiliki N slots T0542 / 05 - 06 T0542 / 05 - 07 MESSAGE PASSING Menggunakan dua primitives: • Send (destination, &message) • Receive (source, &message) • • • • • Beberapa isu pada sistem message passing Message lost Acknowledgement Domains Authentication Performance Pereapan producer-consumer problem menggunakan message passing T0542 / 05 - 08 T0542 / 05 - 09 Beberapa variant dari message passing: • Mailbox • Rendezvous • Pipe
© Copyright 2026 Paperzz