1# @ajax/mesh-words-host
23`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.
67```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```
1213## Ported from
1415[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.
1819## Tests
2021- `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.
2324## Device code
2526Host only (C11 atomics on a CPU mapping); GPU runtimes implement `mesh_words` with their own atomics.
2728## Licence
2930MIT. See the repository's LICENSE.