pub struct StdDefaultPool { /* private fields */ }
Expand description
Native standard thread pool.
This is the default thread pool used when “std” feature is enabled.
Note that the thread pool to be used for a parallel computation can be set by the
with_runner
transformation separately for each parallel iterator.
Uses std::thread::scope
and scope.spawn(..)
to distribute work to threads.
Value of max_num_threads
is determined as the minimum of:
- the available parallelism of the host obtained via
std::thread::available_parallelism()
, and - the upper bound set by the environment variable “ORX_PARALLEL_MAX_NUM_THREADS”, when set.
Trait Implementations§
Source§impl Default for StdDefaultPool
impl Default for StdDefaultPool
Source§impl ParThreadPool for &StdDefaultPool
impl ParThreadPool for &StdDefaultPool
Source§type ScopeRef<'s, 'env, 'scope> = &'s Scope<'s, 'env>
where
'scope: 's,
'env: 'scope + 's
type ScopeRef<'s, 'env, 'scope> = &'s Scope<'s, 'env> where 'scope: 's, 'env: 'scope + 's
Scope type of the thread pool.
Source§fn max_num_threads(&self) -> NonZeroUsize
fn max_num_threads(&self) -> NonZeroUsize
Returns the maximum number of threads available in the pool.
Source§fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
Executes the scoped computation
f
.Source§impl ParThreadPool for StdDefaultPool
impl ParThreadPool for StdDefaultPool
Source§type ScopeRef<'s, 'env, 'scope> = &'s Scope<'s, 'env>
where
'scope: 's,
'env: 'scope + 's
type ScopeRef<'s, 'env, 'scope> = &'s Scope<'s, 'env> where 'scope: 's, 'env: 'scope + 's
Scope type of the thread pool.
Source§fn max_num_threads(&self) -> NonZeroUsize
fn max_num_threads(&self) -> NonZeroUsize
Returns the maximum number of threads available in the pool.
Source§fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
Executes the scoped computation
f
.Auto Trait Implementations§
impl Freeze for StdDefaultPool
impl RefUnwindSafe for StdDefaultPool
impl Send for StdDefaultPool
impl Sync for StdDefaultPool
impl Unpin for StdDefaultPool
impl UnwindSafe for StdDefaultPool
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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