The lease: mesh-rt's node loop played by a host thread against the mailbox, for executors without resident kernels (wasm lanes)
$ sexc add @ajax/mesh-lease- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 04:27v/# 1 version
- drwxr-xr-x-Oct 27 04:27files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 04:27 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-mailbox ^0.1.0, @ajax/mesh-abi-ring ^0.1.0, @ajax/mesh-abi-node ^0.1.0, @ajax/mesh-abi-trace ^0.1.0, @ajax/mesh-abi-header ^0.1.0, @ajax/mesh-abi-control-block ^0.1.0, @ajax/mesh-abi-exchange ^0.1.0, @ajax/mesh-abi-pipe ^0.1.0, @ajax/mesh-abi-base ^0.1.0, @ajax/mesh-check ^0.1.0, @ajax/mesh-abi-fault ^0.1.0
- dependents
- @ajax/mesh-exec-wasm, @ajax/mesh-exec-wasm-imports
- keywords
- mesh alphaos lease node-loop wasm
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-lease
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-lease 2 3The lease, ported from alpha-rust-mesh's `mesh-host/src/lease.rs`: mesh-rt's node loop played by a host 4thread against the mailbox, for executors without resident kernels. In this port that is the wasm 5executor's lanes (`@ajax/mesh-exec-wasm`: one lane per node); in the Rust, Metal's dispatches too 6(Metal isn't ported). 7 8A lane takes published tickets in order by CAS on `P_RING_HEAD` (several lanes share a slot's ring 9without a lock), hands them to its runner, completes each exactly as mesh-rt's nodes do (`P_RESULTS`, 10`P_MARKS`, `P_DONE`, the node record, a trace record), heartbeats while idle, keeps the slot's first 11fault, and halts on `P_SHUTDOWN` once nothing is published. `mesh_round` is the lockstep exchange with 12its bounded wait. The Rust's `Runner` trait is a table of functions; its `Arc`s (`done`, `stats`) are 13pointers the caller keeps alive. 14 15Tests: `tests/lease.c`, the Rust's three tests one for one (lanes sharing a ring and halting, a gated 16lane waiting for the blink, the bounded exchange). 17 18## Differences 19 20None in behaviour. Ownership: nobody in the port plan owned `lease.rs` (it served Metal and wasm); the 21wasm area ported it.