Skip to main content

Module runtime

Module runtime 

Source
Expand description

The concurrency, timing, logging and OS-facing primitives an IOC is built on — C libCom’s epicsThread / epicsTime / errlog / envDefs half.

§The two backends

task’s spawn/sleep/interval seam has two mutually exclusive backends, selected by this crate’s build.rs into one cfg rather than repeated as a target/feature predicate at each of the ~two dozen seam sites:

  • tokio_backend — the tokio runtime. The hosted default.
  • exec_backend — the std-thread background executor (callback pool + delayed timer + scanOnce worker). Unconditional on RTEMS, which has no tokio reactor, and host-selectable through the rtems-exec-model feature for a Linux blocking-front-end deployment that wants the same runtime-free backend.

crate::EXEC_BACKEND states which one this build got, so a crate above can pin its own copy of the predicate to it.

Modules§

accept
Backoff for a server accept loop, shared by every accept loop in the workspace.
background
RTEMS-side background-execution infrastructure (CA sans-io refactor, increment W3a — the seam backend).
blocking_io
Blocking socket ⇄ AsyncRead/AsyncWrite adapters: the byte source for every reactor-free driver in the workspace.
build_info
The three EPICS_BUILD_* environment parameters.
env
EPICS environment parameters — C’s envSubr.c.
env_table
EPICS environment parameters — the Rust envData.c.
epics_string
C libCom epicsString.c — the escape-translation half.
fs
Filesystem operations through the runtime seam.
general_time
ioc_role
Which role an IOC thread takes on, and therefore which scheduling band it sits at — the one place that choice is made.
json_string
The JSON string decoder a .db JSON-brace value goes through — C’s yajl.
log
Runtime logging — errlog severity surface plus the rt_* macros.
net
socket
Socket construction with pre-bind options: the one place in the workspace that opens a socket, sets the address-reuse/broadcast options a protocol needs, and only then binds or connects it.
stdlib
The numeric core of C’s strtod for C99 hex floats, shared by every strtod port in the workspace (calc::engine::strtod, the CALC literal scanner, and epics-ca-rs’s estdlib, the env-knob parser).
supervise
Auto-restart supervisor — sliding-window NRESTARTS pattern.
sync
task
time
version
The EPICS Base release this crate ports — the Rust epicsVersion.h.
worker_pool
A bounded set of persistent threads that a connection borrows rather than creates, closing the server-side per-connection thread leak.

Macros§

select
Waits on multiple concurrent branches, returning when the first branch completes, cancelling the remaining branches.