66.3k views
1 vote
This problem has been solved!

See the answer
Consider the following ways of handling deadlock:
(1) banker’s algorithm,
(2) detect deadlock and kill thread, releasing all resources,
(3) reserve all resources in advance,
(4) restart thread and release all resources if thread needs to wait,
(5) resource ordering, and
(6) detect deadlock and roll back thread’s actions.
a) One criterion to use in evaluating different approaches to deadlock is which approach permits the greatest concurrency. In other words, which approach allows the most threads to make progress without waiting when there is no dead- lock? Give a rank order from 1 to 6 for each of the ways of handling deadlock just listed, where 1 allows the greatest degree of concurrency. Comment on your ordering.
b) i. Another criterion is efficiency; in other words, which requires the least processor overhead. Rank order the approaches from 1 to 6, with 1 being the most efficient, assuming that deadlock is a very rare event. Comment on your ordering.
ii. Does your ordering change if deadlocks occur frequently?

1 Answer

5 votes

Answer: a) 135642 b) 146253

Step-by-step explanation:

A)

1- the bankers algorithm tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, as stated this has the greatest degree of concurrency.

3- reserving all resources in advance helps would happen most likely if the algorithm has been used.

5- Resource ordering comes first before detection of any deadlock

6- Thread action would be rolled back much easily of Resource ordering precedes.

4- restart thread and release all resources if thread needs to wait, this should surely happen before killing the thread

2- only option practicable after thread has been killed.

Bii) ; No. Even if deadlock happens rapidly, the safest sequence have been decided already.

User Mikepote
by
7.4k points