Struct pond::Pool

source ·
pub struct Pool { /* private fields */ }
Expand description

Holds a number of threads that you can run tasks on

Implementations

Spawn a pool with the native number of threads and a fixed backlog

The native number of threads is the number of logical cpus according to the crate num_cpus

The backlog, 4 times the number of threads, is the number of unprocessed jobs that are allowed to accumulate from Scope::execute

Spawn a pool with the native number of threads an un unbounded backlog

The native number of threads is the number of logical cpus according to the crate num_cpus

Scope::execute will never block and will accumulate any task you give it. This may require a lot of memory.

Spawn a number of threads. The pool’s queue of pending jobs is limited.

backlog is the number of jobs that haven’t been run. If specified, Scope::execute will block until a job completes.

Spawn a number of threads. The pool’s queue of pending jobs is limited.

the backlog is unbounded as in unbounded.

Store the current scope so that you can run jobs in it.

This function panics if the given closure or any threads panic.

Does not return until all executed jobs complete.

Trait Implementations

terminates all threads

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.