HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
📝
남득윤 학습 저장소
/
🧵
멀티쓰레드, 동시성 프로그래밍
/
🧵
Java Concurrency and Multithreding
/
Deadlock Prevention in Java

Deadlock Prevention in Java

Lock reordering deadlock prevention

  • lock을 reordering 하여 cycle을 없애자!
  • e.g. DeadlockExample, Runnable1, Runnable2
 

Timeout backoff deadlock prevention

일정 시간동안 lock 획득에 실패하면 lock attempt를 포기하고 자신이 들고 있던 lock들을 unlock함 이후 램덤한 시간 이후에 다시 시도.
 

Deadlock detection

notion image