209k views
5 votes
One condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a total ordering of all resource types and to require that each process requests resources in increasing order of enumeration. Given an example of a bank transaction, is deadlock possible for this case

User Feiyu Zhou
by
4.2k points

2 Answers

1 vote

A deadlock refers to a situation in which two computer program that shares the same resource/data are preventing each other from accessing the resource/data , resulting in both programs ceasing to function.

Step-by-step explanation:

A deadlock refers to a situation in which the whole process is locked, since each of the process is waiting or holding the resource of another process. The two process are interdependent on each other and cannot function independently

An example of Deadlock occurring during a bank transaction is

Lets consider two bank accounts of customer X & Customer Y

Now if customer X tries to transfer funds to Customer Y or Y tries to transfer fund to X ,when these 2 process occur simultaneously at the same time a deadlock is said to have occur

User Tomarinator
by
4.1k points
2 votes

Dead lock is possible in Bank Transactions

Step-by-step explanation:

Let us understand the term "Dead lock"

A deadlock is a situation where whole set of process is locked, since each of the process is waiting or holding the resource of another process. Each process will be interdependent and waiting for the same resource.

Deadlock is possible during bank transaction in the following situation:

A & B are two accounts where A tries to transfer funds to B and B tries to transfer fund to A.

When both tries to transfer funds at the same time, deadlock occurs.

A deadlock can be avoided by any one of the four methods.

They are: Mutual exclusion, No preemption, circular wait, hold and wait.

User Yatharth Varshney
by
4.0k points