I am struggling to explain \"deadlock\" in threads in easy words, so please help. What could be the best example of \"deadlock\" (say, in Java), and how it does happen in st
(Slightly over-simplified) There are two people, screwing nuts onto bolts.
The procedure (same for both) is:
So what happens when there is just a nut and a bolt left? The first person picks up a nut, the second grabs a bolt. So far so good, but now they are stuck, each having a resource the other needs.
Without special instructions they will sit there deadlocked forever.
Or you could just show them this video