skip to content
[readonly]

meshd's writes to the program table: entries and pipe blocks under the PT_GEN seqlock, state changes, inbox holds, flight words, fresh slots, lookups

sh
$ sexc add @ajax/mesh-prog-table
  • 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-manifest ^0.1.0, @ajax/mesh-manifest-encode ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-control, @ajax/mesh-driver, @ajax/mesh-inferd, @ajax/mesh-load-text, @ajax/mesh-snapshot
keywords
mesh alphaos program-table seqlock mailbox
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-prog-table
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-prog-table
2
3meshd's writes to the program table: entries and pipe blocks under the PT_GEN seqlock, state changes, inbox holds, flight words, fresh slots, lookups.
4
5The program table as meshd writes it (programs.rs).
6
7meshd is the table's only writer. It rewrites an entry only while that slot's kernel is not running (load, upgrade, rollback, reset happen with it halted), state changes excepted. Rewrites go under the entry's PT_GEN seqlock (odd while writing); every change bumps H_PROG_SEQ so viewers know to re-read. Readers on any thread take a stable copy (read_entry).
8
9```c
10#include "mesh/prog_table.h"
11```
12
13## Ported from
14
15[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/programs.rs: `write_entry`, `set_state`, `clear`, `write_pipe`, `set_hold`, `flight`, `flight_epoch`, `flight_clear`, `reset_slot`, `name_of`, `find`, `read_entry`.
16
17## Tests
18
19- `tests/prog_table.c`: programs.rs's `reset_slot_leaves_the_gpu_run_request` and `table_seqlock` (a reader waiting out an odd PT_GEN on another thread), and the pipe block, flight words and hold.
20
21## Licence
22
23MIT. See the repository's LICENSE.