-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PROTOTYPE: Turn loadMut into inProcessLock
- Clearly separate layerStore fields by how concurrent access is governed (might not be actually accureate at this point) - Then turn loadMut (which currently only ensures exclusion inside ReloadIfChanged) into a RWMutex that protects all readers against changes by ReloadIfChanged. - This adds a new synchronization on the _bodies_ of layerReadAccess, potentially slowing them down _in presence of external writers_ only. - OTOH in layerWriteAccess, we use a single lock scope for both reloadIfChanged and the body, which makes it clear that the lock scope is actually exactly the same as the scope of r.Lock(), and the total overhead should be almost the same as well. (Possibly investigate only having one of inProcessLock and layerStore.Locker.rwMutex. We might not need both.) Signed-off-by: Miloslav Trmač <mitr@redhat.com>
- Loading branch information
Showing
1 changed file
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters