1 / 8

MENDETEKSI DEADLOCK

MENDETEKSI DEADLOCK. 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. Tape drives. Tape drives. CD ROMs. CD ROMs. Scanners. Scanners.

matsu
Download Presentation

MENDETEKSI DEADLOCK

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MENDETEKSIDEADLOCK

  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

  3. Tape drives Tape drives CD ROMs CD ROMs Scanners Scanners Plotters Plotters Available Existing Request Matrix Current Allocation Matrix P1 P1 P2 P2 P3 P3 • Maka resource yang tersedia (availabe) adalah • Tape drives  4 – (0 + 2 + 0) = 2 • Plotters  2 – (0 + 0 + 1) = 1 • Scanners  3 – (1 + 0 + 2) = 0 • CD ROMs  1 – (0 + 1 + 0) = 0

  4. Tape drives Tape drives CD ROMs CD ROMs Scanners Scanners Plotters Plotters Available Existing Request Matrix Current Allocation Matrix P1 P1 P2 P2 P3 P3 • Periksa apakah ada proses yang permintaannya dapat dipenuhi • P1  Apakah (2 0 0 1) <= (2 1 0 0)? Tidak • P2  Apakah (1 0 1 0) <= (2 1 0 0)? Tidak • P3  Apakah (2 1 0 0) <= (2 1 0 0)? Ya

  5. Tape drives Tape drives CD ROMs CD ROMs Scanners Scanners Plotters Plotters Available Existing Request Matrix Current Allocation Matrix P1 P1 P2 P2 P3 P3 • Setelah P3 Selesai • Available = (2 1 0 0) + (0 1 2 0) = (2 2 2 0) • Periksa apakah ada proses yang permintaannya dapat dipenuhi • P1  Apakah (2 0 0 1) <= (2 2 2 0)? Tidak • P2  Apakah (1 0 1 0) <= (2 2 2 0)? Ya

  6. Tape drives Tape drives CD ROMs CD ROMs Scanners Scanners Plotters Plotters Available Existing Request Matrix Current Allocation Matrix P1 P1 P2 P2 P3 P3 • Setelah P2 Selesai • Available = (2 0 0 1) + (2 2 2 0) = (4 2 2 1) • Periksa apakah ada proses yang permintaannya dapat dipenuhi • P1  Apakah (2 0 0 1) <= (4 2 2 1)? Ya

  7. Tape drives Tape drives CD ROMs CD ROMs Scanners Scanners Plotters Plotters Available Existing Request Matrix Current Allocation Matrix P1 P1 P2 P2 P3 P3 • Setelah P1 Selesai • Available = (0 0 1 0) + (4 2 2 1) = (4 2 3 1)

  8. Karena semua permintaan dapat dipenuhi Maka Tidak terjadi deadlock

More Related