Deadlock in java is a programming situation where two or more threads blocked waiting for other blocked waiting thread to finish and thus none of the threads will ever complete example thread A,thread B these two threads are in deadlock state thread A waiting for thread B to finish,thread B waiting for thread A to finish so this process is known as deadlock.

Thoughtgrid

09-16-2016, 12:23 AM

It is an situation more than two threads block forever waiting for same resources at same time you can use some technique to avoid the deadlock these are non overlapping lock,lock ordering,lock timeout,single thread these are some technique used to prevent the deadlock.

jeffronald19

12-28-2016, 09:52 PM

Deadlock describes a situation where two or more threads are blocked forever, waiting for each other.

damponting44

01-17-2017, 12:39 AM

Deadlock can occur in a situation when a thread is waiting for an object lock, that is acquired by another thread and second thread is waiting for an object lock that is acquired by first thread. Since, both threads are waiting for each other to release the lock, the condition is called deadlock.

aceamerican

02-06-2017, 05:03 AM

Deadlock in java is a programming situation where two or more threads are blocked forever.

raynowenhall

02-28-2017, 04:45 AM

Hi, Deadlock situation may be likened to two people who are drawing diagrams, with only one pencil and one ruler between them. If one person takes the pencil and the other takes the ruler, a deadlock occurs when the person with the pencil needs the ruler and the person with the ruler needs the pencil to finish his work with the ruler. Both requests can't be satisfied, so a deadlock occurs.

Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. Deadlock occurs when multiple threads need the same locks but obtain them in different order. It mainly occur because of lock acquisition in wrong order. programmers tries to avoid deadlock but it happens due to programming errors.

tyagi

03-29-2017, 11:21 PM

Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. ... A Java multithreaded program may suffer from the deadlock condition because the synchronized keyword causes the executing thread to block while waiting for the lock, or monitor, associated with the specified object.

Thank you~!

officeshub

03-30-2017, 11:16 PM

In Java Deadlock is an situation in which a thread is waiting for the object lock that is hold by another thread and that another is waiting for the object lock which is hold by the first thread.

dellmerca

07-12-2017, 10:52 PM

A lock occurs when multiple processes try to access the same resource at the same time. A deadlock occurs when the waiting process is still holding on to another resource that the first needs before it can finish.

Deadlock condition

Resource1 and resource2 are used by Thread1 and Thread2

Thread1 starts to use Resource1
Thread1 and Thread2 try to start using resource2
Thread2 'wins' and gets resource2 first
now Thread2 needs to use Resource1
Resource1 is already locked by Thread1, which is waiting for Thread2

More on...deadlock in Java (http://net-informations.com/java/cjava/deadlock.htm)

Dell

swikriti.sharma

01-12-2018, 04:59 AM

Deadlock can occur in a situation when a thread is waiting for an object lock, that is acquired by another thread and second thread is waiting for an object lock that is acquired by first thread. Since, both threads are waiting for each other to release the lock, the condition is called deadlock.

jackar56

01-12-2018, 05:24 AM

A deadlock is a state where two, or more, threads are blocked waiting (Java Doc) for the other blocked waiting thread (or threads) to finish and thus none of the threads will ever complete. For example, say we have two threads called thread-A and thread-B. These threads are in a deadlock state if thread-A is waiting for thread-B to finish, while thread-B is waiting for thread-A to finish as shown in the following image. Once in deadlock state, both threads will hang forever.