In the previous article, we talked about how deadlocks occur in Java while working in a multi-threaded environment. Now, we will see how to prevent deadlocks by explaining a couple of corner cases. Avoid Nested Locks In the previous article, we showed an example for deadlock, and it contains nested locks as follows. ... Thread … Continue reading How to Avoid Deadlocks in Java
Tag: concurrency
Java Thread Dump Analysis
Once upon a time, you were on-call within your team schedule and your phone started to ring at midnight... You thought "What the hell is this number?" then you accepted the call. The machine started talking to you, "The CPU of Payment Service is 99 percent right now, and somebody should take an action. To … Continue reading Java Thread Dump Analysis