Expand description
Thread pool for running tasks on other threads.
ThreadPool implements a FIFO task queue where the tasks are executed on
other threads, the amount of threads depending on how the ThreadPool is
constructed. As a fallback, single-threaded platforms are supported by
simply running the task in ThreadPool::join_task.
This module doesn’t do any allocation, and isn’t very usable on its own, it’s intended to be used alongside platform-provided threading functions, by the engine, to construct multithreading utilities.
Structs§
- Task
Handle - Handle to a running or waiting task on a
ThreadPool. - Task
InFlight - Packets sent between threads to coordinate a
ThreadPool. - Thread
Pool - Thread pool for running compute-intensive tasks in parallel.
- Thread
State - State held by
ThreadPoolfor sending and receivingTaskInFlights between it and a thread.
Type Aliases§
- Task
Channel - Channel used by
ThreadPoolfor communicating with the processing threads. - Task
Receiver - The receiving half of a
TaskChannel. - Task
Sender - The sending half of a
TaskChannel.