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

Sure you can compose mutexes: https://en.cppreference.com/w/cpp/thread/lock

In practice, if you have a global total ordering of mutexes, it's safe to lock any number of them provided you lock them in order.

CSP is interesting but it doesn't apply in a lot of cases, e.g. designing a lock striping mechanism over a database as described in the article would not be very fun with CSP or actors, as the article calls out at the bottom.



> In practice, if you have a global total ordering of mutexes, it's safe to lock any number of them provided you lock them in order.

Very interesting! Such a simple and elegant solution.




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

Search: