hybrid_lock, either shared_lock or unique_lock
Summary: In generic algorithms parameterized by a mutex type, it may be the case that a shared lock is desired if the mutex is a shared mutex and a unique lock is desired otherwise. This allows a wider range of mutex type arguments rather than just permitting shared mutex types. A hybrid lock may be used with read-only access to data; when the mutex type is shared, the lock would be optimized to a shared lock, but when the mutex type is non-shared, the lock would fall back to a unique lock. This may be helpful since writes may dominate reads in some cases and unique locks on non-shared mutex types may be faster than unique locks on shared mutex types. Reviewed By: Gownta Differential Revision: D29624498 fbshipit-source-id: 9caaf9c413fd6ce7ea318906362c3c4330f8d343
Showing
Please register or sign in to comment