DavHau / nix-portable

Nix - Static, Permissionless, Installation-free, Pre-configured
MIT License
788 stars 29 forks source link

Concurrent execution #37

Open ShamrockLee opened 2 years ago

ShamrockLee commented 2 years ago

This makes the behavior closer to the real nix and enables it to be used on HPCs for parallel computing.

AFAIK, the script is unable to be run concurrently so far because of

  1. The use of the global temporary paths
  2. The copy-paste installation process

An example of the "global temporary path" is the "/tmpbin" introduced by #28, which can be workaround by adding random characters to the path used by each instance, the way mktemp does.

The latter could probably be workaround by implementing some kind of wait mechanism through a file or something. I'm not familiar with multi-threading, and might not be able to come up with a thoughtful solution.