skip to content
[readonly]

meshd's shared state between its threads, and the messages they send the driver, the fleet thread and the jobs thread

sh
$ sexc add @ajax/mesh-shared
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 05:23v/# 1 version
  • drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
latest
0.1.0, published Oct 27 05:23 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-mailbox ^0.1.0, @ajax/mesh-abi ^0.1.0, @ajax/mesh-host-block ^0.1.0, @ajax/mesh-loader ^0.1.0, @ajax/mesh-chan ^0.1.0, @ajax/mesh-reply ^0.1.0, @ajax/mesh-buf ^0.1.0, @ajax/mesh-rsfmt ^0.1.0, @ajax/mesh-views ^0.1.0, @ajax/mesh-infer-svc ^0.1.0, @ajax/mesh-jobs-frame ^0.1.0, @ajax/mesh-log ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-control, @ajax/mesh-driver, @ajax/mesh-fleetd, @ajax/mesh-http-relay, @ajax/mesh-inferd, @ajax/mesh-jobd, @ajax/mesh-load-text, @ajax/mesh-samplers, @ajax/meshd
keywords
mesh alphaos daemon state commands threads
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-shared
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-shared
2
3meshd's shared state between its threads, and the messages they send the driver, the fleet thread and the jobs thread.
4
5State shared by meshd's threads, and the messages they send the driver (commands), the fleet thread (events) and the jobs thread (shared.rs).
6
7The driver thread is the only ring publisher and program-table writer: every other thread asks it through `cmd` and waits on a one-shot reply. In a fleet every lifecycle change comes from the reconciler (the committed desired state); the control port goes through the leader (`change`).
8
9Payloads that belong to the fleet and jobs areas (placement and fleet messages, links, beats, blob lists) travel as opaque pointers with their free function: this package only carries them.
10
11```c
12#include "mesh/shared.h"
13```
14
15## Ported from
16
17[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/shared.rs: `Src`, `Cmd`, `ViewBytes`, `PeerEvent`, `JobEvent`, `JobReply`, `Shared` (`new`, `send_peer`, `send_peer_wait`, `send_bulk`, `send_mask`, `broadcast`, `fail_stop`, `ask`, `set_peer_state`, `change`, `http`), `mono_us`, `PEER_*`; fleet.rs `Actual` as the inventory record.
18
19## Tests
20
21- `tests/shared.c`: asking the driver (answered, refused, dropped unanswered, timed out, with the Rust's texts), the http relay's counting, link queues (bounded, broadcast to the linked ones, waiting for room), fail-stop.
22
23## Differences
24
25- The fleet's and the jobs' own messages and state travel as opaque pointers with their free functions (`msg`, `fleet_ext`, `jobs_ext`): those areas own them. The texts other threads refresh are one lock's fields.
26
27## Licence
28
29MIT. See the repository's LICENSE.