A deadlock is a situation that comes up when multiple threads are being used in a single java program. During thread execution, threads can access any number of methods they want. To ensure that data is consistent during execution, the methods have a property called "synchronized" which prevents multiple threads from accessing a single method. So under this scenario lets take a look at this example:
Thread A is currently holding a lock on Method A and needs to execute method B in order to complete.
Thread B is currently holding a lock on Method B and needs to execute method A in order to complete.
The above is a classic example of deadlock.
There are four strategies of dealing with deadlock problem:1. The Ostrich ApproachJust ignore the deadlock problem altogether.2. Deadlock Detection and RecoveryDetect deadlock and, when it occurs, take steps to recover.3. Deadlock AvoidanceAvoid deadlock by careful resource scheduling.4. Deadlock PreventionPrevent deadlock by resource scheduling so as to negate at least one of the four conditions.
The antonym for deadlock is agreement.
Holy Deadlock was created in 1934.
Deadlock - film - was created in 1931.
Wedlock Deadlock was created in 1947.
House of Dreams - 2004 To Deadlock or Not to Deadlock 1-3 was released on: USA: 22 January 2004
Holy Deadlock has 311 pages.
deadlock handling by 2phase protocol
Wolves - Deadlock album - was created in 2007.
Deadlock - metal band - was created in 1997.
the coordinator conculde incorrectly that a deadlock exist and kills some process --------------------------- Detecting a non existent deadlock in distributed system has been referred as false deadlock and it may occur due to communication delay.. ---->Ashok Paranjothi
The advantage of deadlock prevention is that it installs competition and cost may become. The disadvantage of deadlock prevention is that it takes a significant amount of time to plan for it.