experimental-lda
experimental-lda copied to clipboard
Difference between shared_mutex::lock_shared() and shared_mutex::lock()
Who knows the difference between following two functions.
shared_mutex::lock_shared() and shared_mutex::lock()
shared_mutex::lock() provides exclusive ownership to the mutex whereas shared_mutex::lock_shared() provides a shared ownership. Such constructs are useful for example when you want to have a write and read lock, i.e. there is no problem in multiple threads reading at same time but when you want to write only one thread should write and no one else should be reading at the same time.
thanks for your answering,I am developing unsymmetrical function to this code,may I have your help please?