Function create_thread_pool

Source
pub fn create_thread_pool(
    allocator: &'static LinearAllocator<'_>,
    platform: &dyn Platform,
    task_queue_length: usize,
) -> Option<ThreadPool>
Expand description

Creates a thread pool, reserving space for buffering task_queue_length tasks per thread.

The task queue lengths are relevant in that they limit how many ThreadPool::spawn_task calls can be made before ThreadPool::join_task needs to be called to free up space in the queue. parallelize only requires 1, as it only allocates one task per thread, and requires the thread pool to be passed in empty.