skip to content
[readonly]

mesh_words over a host mapping of the mailbox, with C11 atomics

sh
$ sexc add @ajax/mesh-words-host
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 01:45v/# 1 version
  • drwxr-xr-x-Oct 27 01:45files/# the files of 0.1.0
latest
0.1.0, published Oct 27 01:45 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-abi-words ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-inproc, @ajax/mesh-mailbox, @ajax/mesh-prog-pipehash
keywords
mesh alphaos mailbox atomics host
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-words-host
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-words-host
2
3`mesh_words` (the mailbox access interface of @ajax/mesh-abi-words) over a host mapping of the mailbox,
4with C11 atomics: loads are acquire, stores release, CAS and add acq_rel, and byte copies move
5little-endian words with relaxed loads and stores.
6
7```c
8#include "mesh/words_host.h"
9mesh_words w = mesh_words_host(mailbox);   /* mailbox: the mapped MAILBOX_BYTES, 4-byte aligned */
10mesh_pipe_push(&w, me, consumer, rec, len);
11```
12
13## Ported from
14
15[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): the host
16implementations of `mesh_abi::v2::pipe::{Words, Bytes}`. Rust's pipe tests use the same orderings over a
17`Vec<AtomicU32>`; the host runtimes (mesh-host's wasm lanes, mesh-worker) over the mapped mailbox.
18
19## Tests
20
21- `tests/words_host.c`: loads, stores, CAS, add, byte order and partial words.
22- @ajax/mesh-abi-pipe-ring and @ajax/mesh-abi-pipe run the Rust's pipe tests over it.
23
24## Device code
25
26Host only (C11 atomics on a CPU mapping); GPU runtimes implement `mesh_words` with their own atomics.
27
28## Licence
29
30MIT. See the repository's LICENSE.