Q
Q
Question_man2018-09-07 12:43:09
Java
Question_man, 2018-09-07 12:43:09

How to recognize deadlock?

How can I understand if I caught a deadlock? Should some exception be thrown or will the program hang forever?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alfss, 2018-09-07
@Question_man

I suggest to try it in practice: https://www.tutorialspoint.com/java/java_thread_de...

P
protven, 2018-09-07
@protven

Dump threads using the standard utility from the JDK - jstack.
jstack $PID .
There will obviously be information about the deadlock in the output, if you really have this case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question