CodeGym /Courses /Java Multithreading /Practice writing your own deadlocks

Practice writing your own deadlocks

Java Multithreading
Level 7 , Lesson 4
Available

"Hi, Amigo!"

8
Task
Java Multithreading, level 7, lesson 4
Locked
Causing deadlock
Arrange modifiers so that this code causes deadlock. The main method causes deadlock, so it isn't tested.
8
Task
Java Multithreading, level 7, lesson 4
Locked
Modifiers and deadlock
Arrange modifiers so that this code causes deadlock. The main method causes deadlock, so it isn't tested.
8
Task
Java Multithreading, level 7, lesson 4
Locked
Another kind of deadlock
In the secondMethod method, arrange the synchronized blocks so that threads create deadlock when using the Solution class.
Comments (5)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Evgeniia Shabaeva Level 41, Budapest, Hungary
6 March 2025
I wish I could be paid for causing deadlock)))
Justin Smith Level 41, Greenfield, USA, United States
30 March 2022
These tasks might seem really pedestrian, as there is no challenge to solve them and you just do what the instructions tell you to do. But I think CodeGym is trying to make a point here: deadlock comes from using synchronized carelessly.
8 April 2021
I found this tutorial on Synchronized very useful
Andrei Level 41
7 May 2021
Haha I could've sworn it was going to be from Jenkov! Great resource. 😁
Vahan Level 41, Tbilisi, Georgia
31 March 2020
Great! Now we know how create deadlock!