pub struct ThreadpoolBuilder { /* private fields */ }
Expand description
A builder for AffinitizedThreadpool
.
Implementations§
Source§impl ThreadpoolBuilder
impl ThreadpoolBuilder
Sourcepub fn max_bounded_workers(&mut self, n: u32) -> &mut Self
pub fn max_bounded_workers(&mut self, n: u32) -> &mut Self
Sets the maximum number of bounded kernel workers for each worker ring, per NUMA node.
This defaults in the kernel to min(io_ring_size, cpu_count * 4)
.
Sourcepub fn max_unbounded_workers(&mut self, n: u32) -> &mut Self
pub fn max_unbounded_workers(&mut self, n: u32) -> &mut Self
Sets the maximum number of unbounded kernel workers for each worker ring, per NUMA node.
This defaults to the process’s RLIMIT_NPROC
limit at time of
threadpool creation.
Sourcepub fn ring_size(&mut self, ring_size: u32) -> &mut Self
pub fn ring_size(&mut self, ring_size: u32) -> &mut Self
Sets the IO ring size. Defaults to 256.
Sourcepub fn build(&self) -> Result<AffinitizedThreadpool>
pub fn build(&self) -> Result<AffinitizedThreadpool>
Builds the thread pool.
Trait Implementations§
Source§impl Clone for ThreadpoolBuilder
impl Clone for ThreadpoolBuilder
Source§fn clone(&self) -> ThreadpoolBuilder
fn clone(&self) -> ThreadpoolBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ThreadpoolBuilder
impl RefUnwindSafe for ThreadpoolBuilder
impl Send for ThreadpoolBuilder
impl Sync for ThreadpoolBuilder
impl Unpin for ThreadpoolBuilder
impl UnwindSafe for ThreadpoolBuilder
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