-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
Service Arch
We are having new use-cases that could benefit from a shared-mutex type. Examples include but are not limited to:
SERVER-57811: uses a custom SpinLock implementation to swap the storage engine.SERVER-51055: introduced SyncUnique to avoid data-races while setting/getting ServiceContext fields (e.g., fastClockSource).
The absence of a shared-mutex type leaves developers with no option other than introducing new, case-specific shared-mutex-like types.
The desired interface is very similar to std::shared_mutex, but the implementation should address the following:
- The shared path must be very fast, and almost impose no cost.
- Both exclusive and shared accesses must be interruptible (e.g., by accepting a object that implements the Interruptible interface).
- Often, it is okay to delay the exclusive path in favor of the shared path. This should be considered in implementing the shared-mutex type.
The aim of this ticket is to:
- Identify the shared-mutex implementation that fits the above considerations/requirements.
- Wrap the implementation inside a Mongo library under stdx namespace.
- File tickets to replace existing code that is no longer relevant with the introduction of the new shared-mutex type.
- duplicates
-
SERVER-86656 Create a reader-optimized reader-writer mutex
- Closed
- is duplicated by
-
SERVER-59185 std::shared_mutex and boost::shared_mutex are disallowed but no stdx:: exists
- Closed
- is related to
-
SERVER-51055 ServiceContext getters/setters are racing
- Closed
-
SERVER-57811 API to start storage with alternate location
- Closed
- related to
-
SERVER-87346 Complete TODO listed in SERVER-59157
- Closed