4 ms·
Sure you can compose mutexes: https://en.cppreference.com/w/cpp/thread/lock https://en.cppreference.com/w/cpp/thread/lock In practice, if you have a global tot
by vore 4y ago
Sure you can compose mutexes: https://en.cppreference.com/w/cpp/thread/lock 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.
- paskozdilar 4y ago> 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.