1.

What Is A Deadlock? How Do You Find If Your Java Program Has A Deadlock?

Answer»

The deadlock is a CONDITION which can occur between two or multiple threads. In this case, each of the THREAD waits for each other and cannot progress. In Java, this usually happens when thread 1 holds the LOCK required by thread 2 and thread 2 holds the lock required by thread 1. If your Java program is hung then it COULD be a deadlock. You can TAKE a thread dump and find out if any thread is waiting for the lock hold by other and vice-versa. You can also use jConsole tool to find deadlock.

The deadlock is a condition which can occur between two or multiple threads. In this case, each of the thread waits for each other and cannot progress. In Java, this usually happens when thread 1 holds the lock required by thread 2 and thread 2 holds the lock required by thread 1. If your Java program is hung then it could be a deadlock. You can take a thread dump and find out if any thread is waiting for the lock hold by other and vice-versa. You can also use jConsole tool to find deadlock.



Discussion

No Comment Found