Skip to main content

Module parallel

Module parallel 

Source
Expand description

Thread pools.

One Executor over a rayon::ThreadPool.

rayon’s scoped parallelism covers what this library needs: a par_iter over batches writes into indexed slots, which is submission order. There is no completion-ordered result stream and no handle-checkout semaphore, because nothing here wants either.

One pool per reader, owned for its lifetime, so that a request reading a few blocks does not pay to start and join threads. close() drops the executor and that is what gives the threads back — but dropping a rayon pool only signals its workers, so Executor keeps every JoinHandle and joins them itself. See its Drop.

Structs§

Executor
Promise
A one-shot slot a worker fills and its submitter waits on.

Constants§

RECOMMENDED_MAX_THREADS
One thread per core, capped here.

Functions§

resolve_parallel
Turn the parallel argument of the public API — where zero or less spells “you decide” — into a thread count.