pub struct PlottingThreadPoolManager { /* private fields */ }Expand description
Plotting thread pool manager.
This abstraction wraps a set of thread pool pairs and allows to use them one at a time.
Each pair contains one thread pool for plotting purposes and one for replotting, this is because they’ll share the same set of CPU cores in most cases, and it would be inefficient to use them concurrently.
For example on machine with 64 logical cores and 4 NUMA nodes it would be recommended to create 4 thread pools with 16 threads each plotting thread pool and 8 threads in each replotting thread pool, which would mean work done within thread pool is tied to CPU cores dedicated for that thread pool.
Implementations§
Source§impl PlottingThreadPoolManager
impl PlottingThreadPoolManager
Sourcepub fn new<C>(
create_thread_pools: C,
thread_pool_pairs: NonZeroUsize,
) -> Result<Self, ThreadPoolBuildError>
pub fn new<C>( create_thread_pools: C, thread_pool_pairs: NonZeroUsize, ) -> Result<Self, ThreadPoolBuildError>
Create new thread pool manager by instantiating thread_pools thread pools using
create_thread_pool.
create_thread_pool takes one argument thread_pool_index.
Sourcepub fn thread_pool_pairs(&self) -> NonZeroUsize
pub fn thread_pool_pairs(&self) -> NonZeroUsize
How many thread pool pairs are being managed here
Sourcepub async fn get_thread_pools(&self) -> PlottingThreadPoolsGuard
pub async fn get_thread_pools(&self) -> PlottingThreadPoolsGuard
Get one of inner thread pool pairs, will wait until one is available if needed
Trait Implementations§
Source§impl Clone for PlottingThreadPoolManager
impl Clone for PlottingThreadPoolManager
Source§fn clone(&self) -> PlottingThreadPoolManager
fn clone(&self) -> PlottingThreadPoolManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PlottingThreadPoolManager
impl !RefUnwindSafe for PlottingThreadPoolManager
impl Send for PlottingThreadPoolManager
impl Sync for PlottingThreadPoolManager
impl Unpin for PlottingThreadPoolManager
impl !UnwindSafe for PlottingThreadPoolManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more