Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

If you need deadlock detection, probably your high level design is problematic. But I agree this is extremely often the case, so that's extremely often an interesting and valuable tool.


It’s like saying that if you’re in a car accident you were driving wrong, so drive correctly and don’t buy insurance.

Deadlock detection is insurance, not architecture.


>If you need deadlock detection, probably your high level design is problematic.

You could say the same thing about using a borrow checker. Or a type system.


Not exactly the same for things done dynamically vs. statically.


After chasing a bug for hours just to discover that it is a deadlock, its always easier to realize, in hindsight, that deadlock detection would have been useful.

Independently of how perfect your architecture is, the moment you add a Mutex to your app, you are opening the door for that to happen.

IMO not worth it.


More like the moment you add a second Mutex in your app, ad-hoc handling and no policy to prevent deadlocks.

The solutions are well known and I'm simply sad to see them far too little used.

But in the case you insist in doing that (not using architectural solutions, some of which can be checked statically), yes of course runtime deadlock detection is a very valuable tool. I agree that it is even useful if you rely on policy but can't automatically check that they are respected.


I mostly agree with this except I think the bigger thing is that you should rarely be using locks in the first place. Instead use existing parallel data structures and atomics.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: