Upload presentasi
Presentasi sedang didownload. Silahkan tunggu
1
MENDETEKSI DEADLOCK
2
Contoh algoritma pendeteksian deadlock dengan Multiple Resource of Each Type
Terdapat 4 sumberdaya Tape drives 4 buah Plotters 2 buah Scanner 2 buah CDRom 2 buah Terdapat 3 proses Proses 1 menggunakan 1 scanner meminta 2 tape drives dan 1 CDRoms Proses 2 menggunakan 2 tape drives dan 1 CDRoms meminta 1 tape drives dan 1 scanner Proses 3 menggunakan 1 plotter dan 2 scanner meminta 2 tape drives dan 1 plotter
3
Current Allocation Matrix Request Matrix
Tape drives CD ROMs Tape drives CD ROMs Scanners Scanners Plotters Plotters Existing 4 2 3 1 Available 2 1 Current Allocation Matrix Request Matrix P1 1 2 P1 2 1 P2 P2 P3 P3 Maka resource yang tersedia (availabe) adalah Tape drives 4 – ( ) = 2 Plotters 2 – ( ) = 1 Scanners 3 – ( ) = 0 CD ROMs 1 – ( ) = 0
4
Current Allocation Matrix Request Matrix
Tape drives CD ROMs Tape drives CD ROMs Scanners Scanners Plotters Plotters Existing 4 2 3 1 Available 2 1 Current Allocation Matrix Request Matrix P1 1 2 P1 2 1 P2 P2 P3 P3 Periksa apakah ada proses yang permintaannya dapat dipenuhi P1 Apakah ( ) <= ( )? Tidak P2 Apakah ( ) <= ( )? Tidak P3 Apakah ( ) <= ( )? Ya
5
Current Allocation Matrix Request Matrix
Tape drives CD ROMs Tape drives CD ROMs Scanners Scanners Plotters Plotters Existing 4 2 3 1 Available 2 Current Allocation Matrix Request Matrix P1 1 2 P1 2 1 P2 P2 P3 P3 Setelah P3 Selesai Available = ( ) + ( ) = ( ) Periksa apakah ada proses yang permintaannya dapat dipenuhi P1 Apakah ( ) <= ( )? Tidak P2 Apakah ( ) <= ( )? Ya
6
Current Allocation Matrix Request Matrix
Tape drives CD ROMs Tape drives CD ROMs Scanners Scanners Plotters Plotters Existing 4 2 3 1 Available 4 2 1 Current Allocation Matrix Request Matrix P1 1 2 P1 2 1 P2 P2 P3 P3 Setelah P2 Selesai Available = ( ) + ( ) = ( ) Periksa apakah ada proses yang permintaannya dapat dipenuhi P1 Apakah ( ) <= ( )? Ya
7
Current Allocation Matrix Request Matrix
Tape drives CD ROMs Tape drives CD ROMs Scanners Scanners Plotters Plotters Existing 4 2 3 1 Available 4 2 3 1 Current Allocation Matrix Request Matrix P1 1 P1 2 1 P2 P2 P3 P3 Setelah P1 Selesai Available = ( ) + ( ) = ( )
8
Tidak terjadi deadlock
Karena semua permintaan dapat dipenuhi Maka Tidak terjadi deadlock
Presentasi serupa
© 2024 SlidePlayer.info Inc.
All rights reserved.