Module worker
worker
Thread pool with per-core thread affinity and round-robin task distribution.
Each task is pinned to a worker thread (no work stealing). Each worker thread has its own GC heap and async IO event loop.
Functions
spawn
function
get_num_threads
function
fn() -> usize
Get the number of worker threads in the pool. Defaults to the number of hardware threads (CPU cores).
Returns: usize
set_num_threads
function
fn(num : usize) -> unit
Set the number of worker threads in the pool.
Must be called before the first spawn to take effect.
Parameters
| Name | Type | Notes |
|---|---|---|
num | usize |
Returns: unit