Module aoc::util::thread

source ·
Expand description

Utility methods to spawn a number of scoped threads equals to the number of cores on the machine. Unlike normal threads, scoped threads can borrow data from their environment.

Functions§

  • Spawn n scoped threads, where n is the available parallelism.
  • Splits items into batches, one per thread. Items are assigned in a round robin fashion, to achieve a crude load balacing in case some items are more complex to process than others.
  • threads 🔒