Can someone please explain in what scenario's it would be beneficial to use std::mutex vs pthread_mutex_t. I dont understand why we would ever use pthread_mutex_t. Thanks
The pthread_mutex_t
is a POSIX solution (available for linux and other UNIX systems) that existed before c++11 introduced synchronisation primitives into the c++ library. You should use std::mutex
now, amongst other things it is more cross-platform (can be used under Windows also).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With