Function runWorkerTaskDist
Runs a new asynchronous task in all worker threads concurrently.
void runWorkerTaskDist(FT, ARGS...)
(
FT func,
auto ref ARGS args
)
if (isFunctionPointer!FT && isNothrowCallable!(FT, ARGS));
void runWorkerTaskDist(alias method, T, ARGS...)
(
shared(T) object,
ARGS args
)
if (isNothrowMethod!(shared(T), method, ARGS));
void runWorkerTaskDist(FT, ARGS...)
(
TaskSettings settings,
FT func,
auto ref ARGS args
)
if (isFunctionPointer!FT && isNothrowCallable!(FT, ARGS));
void runWorkerTaskDist(alias method, T, ARGS...)
(
TaskSettings settings,
shared(T) object,
ARGS args
)
if (isNothrowMethod!(shared(T), method, ARGS));
This function is mainly useful for long-living tasks that distribute their work across all CPU cores. Only function pointers with weakly isolated arguments are allowed to be able to guarantee thread-safety.
The number of tasks started is guaranteed to be equal to
workerThreadCount
.