pub struct ProcessCpus { /* private fields */ }Expand description
The CPUs the process may run on, read once before any thread is kept under one cache.
Threads a device server spawns inherit its cache; those with no launches to stay near, such as compile workers, spread back over every CPU.
Implementations§
Source§impl ProcessCpus
impl ProcessCpus
Sourcepub fn parallelism(&self) -> usize
pub fn parallelism(&self) -> usize
How many threads the process may run at once.
Sourcepub fn spread_current_thread(&self)
pub fn spread_current_thread(&self)
Lets the calling thread run on every CPU, undoing the cache it inherited from a server.
Auto Trait Implementations§
impl Forget for ProcessCpus
impl Freeze for ProcessCpus
impl RefUnwindSafe for ProcessCpus
impl Send for ProcessCpus
impl Sync for ProcessCpus
impl Unpin for ProcessCpus
impl UnsafeUnpin for ProcessCpus
impl UnwindSafe for ProcessCpus
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