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

It looks like they default to using recursive mutexes. In my experience those are a recipe for hard to debug deadlocks because if you acquire multiple locks, it's hard to ensure you always acquire them in the same order.


Like anything and everything in Serenity, if you think it could be better, make it so.


there's an old trick for that that works pretty well; always acquire all locks you need in alphabetical (or some sorted) order


The problem is that you can't statically confirm this via static analysis when you use recursive locks. You can only use runtime lock dep analysis to figure out when you might have gotten it wrong. Often you may not acquire locks in the same function, so it's not very intuitive based on control flow to understand whether or not you've acquired them in the wrong order.




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

Search: