Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SharedSync class #10868

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

edolstra
Copy link
Member

@edolstra edolstra commented Jun 6, 2024

Motivation

SharedSync is like Sync, but it uses std::shared_mutex instead of std::mutex. This allows you to get shared (non-exclusive) const access to the data by calling foo.read(), and exclusive write access by calling foo.lock().

The goal is to reduce lock contention for read access to shared data structures in the multi-threaded evaluator. (See the PosixSourceAccessor stat cache for an example.)

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@Ericson2314 Ericson2314 changed the title Add SharedSync class Add SharedSync class Jun 6, 2024
@Ericson2314 Ericson2314 merged commit dd46ed8 into NixOS:master Jun 6, 2024
10 checks passed
@cole-h cole-h deleted the shared-sync branch June 6, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants