byteor_pipeline_exec/
lib.rs

1#![deny(missing_docs)]
2#![deny(unreachable_pub, rust_2018_idioms)]
3#![forbid(unsafe_code)]
4
5//! Executors (SP + SingleRing) and loop control.
6//!
7//! This crate runs threads/loops. It must remain free of product policy.
8
9#[cfg(feature = "shm")]
10extern crate alloc;
11
12mod error;
13#[cfg(feature = "mem")]
14mod mem;
15mod registry;
16#[path = "sp.rs"]
17mod lane_graph_impl;
18mod stage;
19mod thread_init;
20
21#[cfg(feature = "shm")]
22#[path = "single_ring.rs"]
23mod single_ring_impl;
24
25pub use error::ExecError;
26pub use registry::{ResolvedStageFactory, SliceStageRegistry, StageEntry};
27pub use thread_init::{RoleKind, ThreadInitContext, ThreadInitHook};
28
29/// LaneGraph-oriented executor APIs.
30pub mod lane_graph {
31    pub use crate::lane_graph_impl::validate_sp;
32
33    #[cfg(feature = "shm")]
34    pub use crate::lane_graph_impl::{
35        run_lane_graph_mp_role_shm, run_sp, spawn_lane_graph_sp_shm_runtime,
36        spawn_lane_graph_sp_shm_runtime_with_thread_init, LaneGraphRoleActivitySnapshot,
37        LaneGraphSpRuntime, SpShmOptions,
38    };
39}
40
41/// SingleRing-oriented executor APIs.
42pub mod single_ring {
43    #[cfg(feature = "mem")]
44    pub use crate::mem::run_single_ring_mem;
45
46    #[cfg(feature = "shm")]
47    pub use crate::single_ring_impl::{
48        run_single_ring_shm, run_single_ring_shm_per_key_sharded_with_wait,
49        run_single_ring_shm_per_key_sharded_with_wait_and_resolver,
50        run_single_ring_shm_per_key_sharded_with_wait_and_resolver_and_prefault,
51        run_single_ring_shm_per_key_sharded_with_wait_and_resolver_and_thread_init,
52        run_single_ring_shm_per_key_sharded_with_wait_and_resolver_and_thread_init_and_prefault,
53        run_single_ring_shm_record_with_wait_and_resolver_and_thread_init,
54        run_single_ring_shm_with_wait, run_single_ring_shm_with_wait_and_resolver,
55        run_single_ring_shm_with_wait_and_resolver_and_prefault,
56        run_single_ring_shm_with_wait_and_resolver_and_thread_init,
57        run_single_ring_shm_with_wait_and_resolver_and_thread_init_and_prefault,
58        spawn_single_ring_shm_runtime, spawn_single_ring_shm_runtime_with_wait,
59        spawn_single_ring_shm_runtime_with_wait_and_resolver,
60        spawn_single_ring_shm_runtime_with_wait_and_resolver_and_prefault,
61        spawn_single_ring_shm_runtime_with_wait_and_resolver_and_thread_init,
62        spawn_single_ring_shm_runtime_with_wait_and_resolver_and_thread_init_and_prefault,
63        SingleRingSpRuntime, WaitPreset,
64    };
65}
66
67#[cfg(feature = "mem")]
68pub use single_ring::run_single_ring_mem;
69pub use lane_graph::validate_sp;
70
71#[cfg(feature = "shm")]
72pub use lane_graph::{
73    run_lane_graph_mp_role_shm, run_sp, spawn_lane_graph_sp_shm_runtime,
74    spawn_lane_graph_sp_shm_runtime_with_thread_init, LaneGraphRoleActivitySnapshot,
75    LaneGraphSpRuntime, SpShmOptions,
76};
77pub use stage::{
78    resolve_or_err, ResolvedStage, StageError, StageResolver, StatefulStage, StatefulStageBox,
79    StatefulTransformStage, StatefulTransformStageBox,
80};
81
82#[cfg(feature = "shm")]
83pub use single_ring::{
84    run_single_ring_shm, run_single_ring_shm_per_key_sharded_with_wait,
85    run_single_ring_shm_per_key_sharded_with_wait_and_resolver,
86    run_single_ring_shm_per_key_sharded_with_wait_and_resolver_and_prefault,
87    run_single_ring_shm_per_key_sharded_with_wait_and_resolver_and_thread_init,
88    run_single_ring_shm_per_key_sharded_with_wait_and_resolver_and_thread_init_and_prefault,
89    run_single_ring_shm_record_with_wait_and_resolver_and_thread_init,
90    run_single_ring_shm_with_wait, run_single_ring_shm_with_wait_and_resolver,
91    run_single_ring_shm_with_wait_and_resolver_and_prefault,
92    run_single_ring_shm_with_wait_and_resolver_and_thread_init,
93    run_single_ring_shm_with_wait_and_resolver_and_thread_init_and_prefault,
94    spawn_single_ring_shm_runtime, spawn_single_ring_shm_runtime_with_wait,
95    spawn_single_ring_shm_runtime_with_wait_and_resolver,
96    spawn_single_ring_shm_runtime_with_wait_and_resolver_and_prefault,
97    spawn_single_ring_shm_runtime_with_wait_and_resolver_and_thread_init,
98    spawn_single_ring_shm_runtime_with_wait_and_resolver_and_thread_init_and_prefault,
99    SingleRingSpRuntime, WaitPreset,
100};
101
102#[cfg(test)]
103mod tests;