Skip to main content

Crate zero_pool

Crate zero_pool 

Source
Expand description

§Zero-Pool

High-performance thread pool with:

  • Lock-free MPMC queue with epoch-based memory reclamation
  • Function pointer dispatch (no trait objects / virtual dispatch)
  • Zero external dependencies
use zero_pool::ZeroPool;

struct Params { value: u64, result: *mut u64 }

fn task(p: &Params) { unsafe { *p.result = p.value * 2; } }

let pool = ZeroPool::new();
let mut result = 0;
pool.run(task, &[Params { value: 42, result: &raw mut result }]);
assert_eq!(result, 84);

Structs§

Scope
A scope for spawning concurrent tasks that borrow from the local stack.
ZeroPool
A high-performance thread pool with lock-free task dispatch.

Functions§

global_pool
Returns a reference to the lazily initialized global pool.