skip to content
[readonly]

posix_spawn of a worker with chosen descriptors and extra environment in its own process group, close-on-exec pipes, and exit statuses described as meshd reports them

sh
$ sexc add @ajax/mesh-spawn
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 02:57v/# 1 version
  • drwxr-xr-x-Oct 27 02:57files/# the files of 0.1.0
latest
0.1.0, published Oct 27 02:57 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-text ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-mps, @ajax/mesh-native
keywords
mesh alphaos process spawn posix
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-spawn
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-spawn
2
3Starting worker processes: `posix_spawn` (never fork: a fork of meshd copies the page tables of its GPU mappings under the mm lock) with this process's environment plus overrides, chosen descriptors dup2'd in (sources moved above the targets first), a process group of its own; close-on-exec pipes; exit statuses as meshd reports them (`exit 3`, `signal 9 (Killed)`) and P_EXIT's encoding.
4
5## Ported from
6
7[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/native.rs (`spawn`, `pipe`, `describe`, `exit_word`).
8
9## Tests
10
11`tests/spawn.c`: descriptors, environment overrides, the process group, exit codes, signals and a missing program.
12
13## Licence
14
15MIT. See the repository's LICENSE.