CS 551: Distributed Operating Systems |
Banker's Algorithm |
State |     Current Loan |   Maximum Need |
---|---|---|
Process A |                 0 |               3 |
Process B |                 3 |               5 |
Process C |                 4 |               7 |
State |     Current Loan |   Maximum Need |
---|---|---|
Process A |                 5 |               7 |
Process B |                 2 |               5 |
Process C |                 1 |               3 |
State |     Current Loan |   Maximum Need |
---|---|---|
Process A |                 0 |               3 |
Process B |                 3 |               5 |
Process C |                 5 |               7 |
"An unsafe state does not imply the existence of deadlock. What an unsafe state does imply is simply that some unfortunate sequence of events might lead to deadlock."
Process Name     | Tape Drives     | Graphics     | Printers     | Disk Drives |
---|---|---|---|---|
Process A |           2 |           0 |           1 |           1 |
Process B |           0 |           1 |           0 |           0 |
Process C |           1 |           0 |           1 |           1 |
Process D |           1 |           1 |           0 |           1 |
Process Name     | Tape Drives     | Graphics     | Printers     | Disk Drives |
---|---|---|---|---|
Process A |           1 |           1 |           0 |           0 |
Process B |           0 |           1 |           1 |           2 |
Process C |           3 |           1 |           0 |           0 |
Process D |           0 |           0 |           1 |           0 |
    (1, 0, 2, 0) |       Current value of Available |
+   (1, 1, 0, 1) |       Allocation (Process D) |
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` | |
    (2, 1, 2, 1) |       Updated value of Available |
    (2, 1, 2, 1) |       Current value of Available |
+   (2, 0, 1, 1) |       Allocation (Process A) |
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` | |
    (4, 1, 3, 2) |       Updated value of Available |
    (4, 1, 3, 2) |       Current value of Available |
+   (0, 1, 0, 0) |       Allocation (Process B) |
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` | |
    (4, 2, 3, 2) |       Updated value of Available |
    (4, 2, 3, 3) |       Current value of Available |
+   (1, 0, 1, 1) |       Allocation (Process C) |
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` | |
    (5, 2, 4, 3) |       Updated value of Available |