2 ms·
"How to avoid deadlocks in Java" I'm curious, this is not something I've needed to know, but what would be Java specific to an answer? If I was asked about de
by perl4ever 7y ago
"How to avoid deadlocks in Java"
I'm curious, this is not something I've needed to know, but what would be Java specific to an answer?
If I was asked about deadlocks, I would say "always acquire resources in the same order".
- collyw 7y agoIt was a Java job. They said that it didn't matter that I do Python most of the time, and as I say threading isn't something that has come up since university for me. I imagine it would take half a day or reading to remember it again.
- tomp 7y ago> If I was asked about deadlocks, I would say "always acquire resources in the same order". I don't think that's the correct solution, unfortunately - see e.g. the dining philosophers problem. Edit: or rather, you have to be very careful what the "order" of resources is.