skip to content
==> README.md <==
1# @ajax/mesh-worker-node
2
3mesh-rt's node loop on CPU threads: claim the next published ticket (E_SEQ acquire, then a CAS on P_RING_HEAD), run `init` (OP_INIT) or `task`, complete it (P_RESULTS, P_MARKS release, P_DONE, the node record, a trace record), heartbeat while idle with a backoff that spins first and sleeps longer the longer it waits, and halt at P_SHUTDOWN. `mesh_worker_run_nodes` runs a slot's PT_NODES nodes, a thread each.
4
5## Ported from
6
7[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-worker/src/lib.rs (`node_loop`, `run_nodes`, `idle`).
8
9## Tests
10
11`tests/node.c`: the Rust's `nodes_run_the_ring_like_mesh_rt` (4 nodes, 200 tickets, a bad op, results, counters, node records, traces), `faults_requests_and_peers` and `input_queue_pops_once_each`.
12
13## Licence
14
15MIT. See the repository's LICENSE.