parallel

Convenience functions that forwards to taskPool.parallel. The purpose of these is to make parallel foreach less verbose and more readable.

  1. ParallelForeach!R parallel(R range)
  2. ParallelForeach!R parallel(R range, size_t workUnitSize)
    ParallelForeach!R
    parallel
    (
    R
    )
    (,)

Examples

// Find the logarithm of every number from
// 1 to 1_000_000 in parallel, using the
// default TaskPool instance.
auto logs = new double[1_000_000];

foreach (i, ref elem; parallel(logs))
{
    elem = log(i + 1.0);
}

Meta