Class ParallelDispatch
Namespace: ValveResourceFormat.Renderer.Utils
Assembly: Renderer.dll
Runs an over a range of indices on the thread pool without allocating.
csharp
public sealed class ParallelDispatch : IDisposableInheritance
Implements
Constructors
ParallelDispatch(int)
Creates a dispatch. The workers are built on the first that needs them.
csharp
public ParallelDispatch(int chunkSize = 16)Parameters
chunkSize int
Indices claimed at a time: enough to amortize the interlocked handoff, few enough that heavy items landing together do not strand a thread at the end.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
csharp
public void Dispose()Run(IParallelWork, int)
Runs work over [0, count) and returns once every index has run. A worker's exception is rethrown here.
csharp
public void Run(IParallelWork work, int count)Parameters
work IParallelWork
Work to run. Held for the call only.
count int
Number of indices to run.

