-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a mutex to Skeleton. #466
Conversation
👍 I wonder what we should do about That said, I have no idea if any of this is viable, or if there would be a better approach. |
If we want to make Since DART is not fully (actually almost) thread safe, we can leave considering |
@jslee02 I don't think it's a good idea to nest locks on multiple @mxgrey and I discussed this a bit offline and thought that a function like Unfortunately, There aren't any straightforward answers here. I'm in favor of adding the As usual: multi-threading is hard. 😞 |
@jslee02, @mxgrey: We could take the logic from the above link that @mkoval noted and apply it within a custom implementation of the "lockable" concept (probably You can still deadlock if someone locks the skeletons manually in a pathological order, but that is going to be a problem for any locking scheme that has to acquire multiple mutexes. |
This pull request adds an
std::mutex
toSkeleton
. Most of the methods onSkeleton
are not thread safe, so using some kind of mutex is necessary in a multi-threaded application. It's useful to attach the mutex toSkeleton
so you don't have to manually pass one around to every function that operates on it.