Trait oxidd_core::WorkerManager
source · pub trait WorkerManager: Manager + Sync {
// Required methods
fn current_num_threads(&self) -> usize;
fn join<RA: Send, RB: Send>(
&self,
op_a: impl FnOnce() -> RA + Send,
op_b: impl FnOnce() -> RB + Send,
) -> (RA, RB);
fn broadcast<R: Send>(
&self,
op: impl Fn(BroadcastContext) -> R + Sync,
) -> Vec<R>;
}Expand description
Manager that also has a thread pool
A manager having its own thread pool has the advantage that it may use thread-local storage for its workers to pre-allocate some resources (e.g. slots for nodes) and thereby reduce lock contention.
Required Methods§
sourcefn current_num_threads(&self) -> usize
fn current_num_threads(&self) -> usize
Get the current number of threads
Object Safety§
This trait is not object safe.