pub enum Threads {
Auto,
Fixed(usize),
}Expand description
Worker threads of a search.
Variants§
Auto
auto_threads, read again by every search.
Fixed(usize)
Exactly this many workers (0 counts as 1).
Implementations§
Source§impl Threads
impl Threads
Sourcepub fn most(self) -> usize
pub fn most(self) -> usize
The most workers Threads::wait_turn ever lets run at once.
Sourcepub fn wait_turn(self, k: usize, stop: impl Fn() -> bool)
pub fn wait_turn(self, k: usize, stop: impl Fn() -> bool)
For a long search that starts Threads::most workers: hold worker
k back (between units of work) while auto_threads allows fewer
than k + 1, or until stop(). The count shrinks as other processes
start scans and grows back as they finish, which a count read once at
the start cannot follow: every process of a burst would see the others
idle and take every CPU.
Trait Implementations§
impl Copy for Threads
impl Eq for Threads
impl StructuralPartialEq for Threads
Auto Trait Implementations§
impl Forget for Threads
impl Freeze for Threads
impl Move for Threads
impl RefUnwindSafe for Threads
impl Send for Threads
impl Sync for Threads
impl Unpin for Threads
impl UnsafeUnpin for Threads
impl UnwindSafe for Threads
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