Struct scheduler::thread_per_core::ThreadPerCoreSched
source · pub struct ThreadPerCoreSched<HostType: Host> { /* private fields */ }
Expand description
A host scheduler.
Implementations§
source§impl<HostType: Host> ThreadPerCoreSched<HostType>
impl<HostType: Host> ThreadPerCoreSched<HostType>
sourcepub fn new<T>(cpu_ids: &[Option<u32>], hosts: T, yield_spin: bool) -> Selfwhere
T: IntoIterator<Item = HostType, IntoIter: ExactSizeIterator>,
pub fn new<T>(cpu_ids: &[Option<u32>], hosts: T, yield_spin: bool) -> Selfwhere
T: IntoIterator<Item = HostType, IntoIter: ExactSizeIterator>,
A new host scheduler with threads that are pinned to the provided OS processors. Each thread
is assigned many hosts, and threads may steal hosts from other threads. The number of
threads created will be the length of cpu_ids
.
sourcepub fn parallelism(&self) -> usize
pub fn parallelism(&self) -> usize
sourcepub fn scope<'scope>(
&'scope mut self,
f: impl for<'a, 'b> FnOnce(SchedulerScope<'a, 'b, 'scope, HostType>) + 'scope,
)
pub fn scope<'scope>( &'scope mut self, f: impl for<'a, 'b> FnOnce(SchedulerScope<'a, 'b, 'scope, HostType>) + 'scope, )
Auto Trait Implementations§
impl<HostType> Freeze for ThreadPerCoreSched<HostType>
impl<HostType> !RefUnwindSafe for ThreadPerCoreSched<HostType>
impl<HostType> Send for ThreadPerCoreSched<HostType>
impl<HostType> Sync for ThreadPerCoreSched<HostType>
impl<HostType> Unpin for ThreadPerCoreSched<HostType>
impl<HostType> !UnwindSafe for ThreadPerCoreSched<HostType>
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