Skip to content

Multithreaded evaluator #125

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

Open
wants to merge 119 commits into
base: detsys-main
Choose a base branch
from
Open

Multithreaded evaluator #125

wants to merge 119 commits into from

Conversation

edolstra
Copy link
Collaborator

Motivation

Updated version of NixOS#10938.

Context

edolstra added 30 commits May 20, 2024 10:09
This is a mapping from paths to "resolved" paths (i.e. with
`default.nix` added, if appropriate). `fileParseCache` and
`fileEvalCache` are now keyed on the resolved path *only*.
Previously, the optimistic concurrency approach in `evalFile()` meant
that a `nix search nixpkgs ^` would do hundreds of duplicated
parsings/evaluations. Now, we reuse the thunk locking mechanism to
ensure it's done only once.
This refactoring allows the symbol table to be stored as something
other than std::strings.
This allows symbol IDs to be offsets into an arena whose base offset
never moves, and can therefore be dereferenced without any locks.
This makes it less likely that we concurrently execute tasks that
would block on a common subtask, e.g. evaluating `libfoo` and
`libfoo_variant` are likely to have common dependencies.
@edolstra edolstra force-pushed the multithreaded-eval-v2 branch from 76f5589 to 7ec889d Compare July 2, 2025 12:25
@edolstra edolstra force-pushed the multithreaded-eval-v2 branch from a398df4 to 08bf730 Compare July 3, 2025 14:34
@edolstra edolstra marked this pull request as ready for review July 3, 2025 15:16
Copy link

github-actions bot commented Jul 14, 2025

@github-actions github-actions bot temporarily deployed to pull request July 14, 2025 17:27 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 14, 2025 17:49 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 15, 2025 15:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 15, 2025 17:38 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flake-regression-test Run the flake regressions test suite on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant