What is the difference between unique_lock and shared-lock?

As far as I can tell, only one unique_lock can be associated with a mutex, while several shared_locks can be associated with a common mutex. Why is this useful? Can someone provide an example?

When to use one or the other?

Regards,
Juan Dent
Registered users can post here. Sign in or register to post.