Java thread deadlock: why can't Java recover from the deadlock like a database?

can JVM handle deadlocks in the same way as database transactions? If not, then what is the reason?

throw a brick to attract jade:

the phenomenon of sequential deadlock is described in Java concurrent programming practice, and the philosopher dining problem is mentioned. When a sequential deadlock occurs, a database transaction chooses a victim to release resources and can be reexecuted, and the transaction can be completed normally.
as a result, can JVM find a victim to release resources when a deadlock occurs? Would multithreaded programming be much easier if deadlock avoidance could be accomplished at the JVM level?

again, the question is, can JVM handle deadlocks in the same way as database transactions? If not, then what is the reason?

Mar.22,2021

https://www.quora.com/How-doe.


deadlock avoidance is at most an exception thrown by the lock () method when it will cause a deadlock. Does this make multithreaded programming more complicated? Imagine a situation where every lock () method has the possibility of exception. So PLSQL is also very difficult to write, PLSQL is to encounter this kind of deadlock caused by exception, and always have to find a way to deal with it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea87e4-1ee3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea87e4-1ee3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?