Expand description
A pool of threads for the tools that play many slow tries (playtest,
and later autobalance): every item of a work list run on one of n
threads and timed, the answers given back in the list’s order, so what
is made of them never depends on the thread count. The clock is the
tools’; the core never reads one.
Functions§
- cores
- The threads to use when not told: one a core, or 1 if that’s unknown.
- run
- Runs
runon every item ofworkonthreadsthreads (at least one, and no more than there are items): threadwtakes itemsw,w + threads,w + 2 × threads, …, and times each. The answers come back inwork’s order with their times, or the first error in that order, whatever the thread count: once an item fails, no thread starts a later one, but the earlier ones all run. A panic inrunis resumed here, on the calling thread.