pub struct DedicatedExecutor { /* private fields */ }Expand description
A task executor of a server’s own, at a priority the server chooses.
§Why this exists beside CallbackPool
CallbackPool is the port of callback.c, so its three bands carry C’s
thread priorities and nothing else: epicsThreadPriorityScanLow - 1, + 4,
epicsThreadPriorityScanHigh + 1 — 59, 64, 71. That ladder is parity, not a
preference, and it must not become configurable.
A network server’s band is set against the other servers in the IOC, not
against record processing: pvxs runs its TCP reactor at CAServerLow-2 =
18, CA’s rsrv its own ladder from caservertask.c. Before this type the
only executor a future could be spawned onto was the callback pool, so
every server’s connection future ran at 64 — in the band C reserves for
deferred record processing, sharing its rings. Two consequences, and the
second is the one that bites: the pvxs band layout was not reproduced, and
a slow connection and a deferred record tail could starve each other.
§One ring, whatever band is named
A dedicated executor has one priority by construction, so the
CallbackPriority a caller names on handle selects
nothing — all three slots are the same ring. That is deliberate: it keeps
the handle type shared with the callback pool, so
spawn_future needs no second
form, and it makes naming a band here impossible to get wrong rather than
silently routing work to a ring with no worker.
Implementations§
Source§impl DedicatedExecutor
impl DedicatedExecutor
Sourcepub fn new(name: &str, priority: ThreadPriority, threads: usize) -> Result<Self>
pub fn new(name: &str, priority: ThreadPriority, threads: usize) -> Result<Self>
Start threads workers named name at priority.
Fallible, unlike CallbackPool’s MandatoryThread workers: this
executor belongs to one server, so a thread that cannot start is that
server’s bind failing, not the process aborting. threads is clamped
to at least 1 — an executor with no worker is a queue whose tasks never
run.
Sourcepub fn handle(&self) -> CallbackHandle
pub fn handle(&self) -> CallbackHandle
A submission handle. Every band names the same ring — see the type doc.