1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

* Start of concurrent garbage collection. Processes write temporary

roots to a per-process temporary file in /nix/var/nix/temproots
  while holding a write lock on that file.  The garbage collector
  acquires read locks on all those files, thus blocking further
  progress in other Nix processes, and reads the sets of temporary
  roots.
This commit is contained in:
Eelco Dolstra 2005-01-31 10:27:25 +00:00
parent a7668411a1
commit 1328aa3307
11 changed files with 193 additions and 108 deletions

View file

@ -36,9 +36,10 @@ nix-pull.sh: dependencies.nix
gc.sh: dependencies.nix
gc-concurrent.sh: gc-concurrent.nix
TESTS = init.sh hash.sh lang.sh simple.sh dependencies.sh locking.sh parallel.sh \
build-hook.sh substitutes.sh substitutes2.sh fallback.sh nix-push.sh gc.sh \
gc-concurrent.sh verify.sh nix-pull.sh
#TESTS = init.sh hash.sh lang.sh simple.sh dependencies.sh locking.sh parallel.sh \
# build-hook.sh substitutes.sh substitutes2.sh fallback.sh nix-push.sh gc.sh \
# gc-concurrent.sh verify.sh nix-pull.sh
TESTS = init.sh gc-concurrent.sh
XFAIL_TESTS =

View file

@ -1,6 +1,8 @@
storeExpr=$($TOP/src/nix-instantiate/nix-instantiate gc-concurrent.nix)
outPath=$($TOP/src/nix-store/nix-store -q $storeExpr)
ls -l test-tmp/state/temproots
# Start a build in the background.
$TOP/src/nix-store/nix-store -rvv "$storeExpr" &
@ -8,7 +10,7 @@ pid=$!
# Run the garbage collector while the build is running.
sleep 2
$NIX_BIN_DIR/nix-collect-garbage
$NIX_BIN_DIR/nix-collect-garbage -vvvvv
# Wait for the build to finish.
echo waiting for pid $pid to finish...

View file

@ -26,6 +26,7 @@ ln -s $TOP/scripts/readmanifest.pm $NIX_BIN_DIR/nix/
mkdir -p "$NIX_LOCALSTATE_DIR"/nix/manifests
mkdir -p "$NIX_LOCALSTATE_DIR"/nix/gcroots
mkdir -p "$NIX_LOCALSTATE_DIR"/log/nix
mkdir -p "$NIX_LOCALSTATE_DIR"/temproots
mkdir $NIX_DATA_DIR/nix
cp -prd $TOP/corepkgs $NIX_DATA_DIR/nix/