Class Dispatcher
public static class Dispatcher
- Inheritance
-
Dispatcher
Fields
MaxDegreeOfParallelism
public static int MaxDegreeOfParallelism
Field Value
Methods
For(int, int, Action<int>)
public static void For(int fromInclusive, int toExclusive, Action<int> action)
Parameters
ForBatched(int, Action<int, int>)
public static void ForBatched(int items, Action<int, int> executeBatch)
Parameters
ForBatched<TJob>(int, TJob)
The call producing the least amount of overhead, other methods are built on top of this one.
public static void ForBatched<TJob>(int items, TJob batchJob) where TJob : Dispatcher.IBatchJob
Parameters
items
intThe amount of items to process, this total will be split into multiple batches, each batch runs
TJob
.Process(int, int) with the range of items for that batchbatchJob
TJobAn object shared across all threads running this job, if TJob is a struct each threads will work off of a unique copy of it
Type Parameters
TJob
Exceptions
- Exception
If any of the threads executing this job threw an exception, it will be re-thrown in the caller's scope
ForBatched<T>(int, ref T, delegate*<ref T, int, int, void>)
public static void ForBatched<T>(int items, ref T parameter, delegate*<ref T, int, int, void> executeBatch)
Parameters
Type Parameters
T
ForBatched<T>(int, ref T, delegate*<ref T, int, int, void>)
public static void ForBatched<T>(int items, ref T parameter, delegate*<ref T, int, int, void> executeBatch)
Parameters
Type Parameters
T
ForEach<T>(FastCollection<T>, Action<T>)
public static void ForEach<T>(FastCollection<T> collection, Action<T> action)
Parameters
collection
FastCollection<T>action
Action<T>
Type Parameters
T
ForEach<T>(ConcurrentCollector<T>, ValueAction<T>)
public static void ForEach<T>(ConcurrentCollector<T> collection, Dispatcher.ValueAction<T> action)
Parameters
collection
ConcurrentCollector<T>action
Dispatcher.ValueAction<T>
Type Parameters
T
ForEach<T>(ConcurrentCollector<T>, Action<T>)
public static void ForEach<T>(ConcurrentCollector<T> collection, Action<T> action)
Parameters
collection
ConcurrentCollector<T>action
Action<T>
Type Parameters
T
ForEach<T>(List<T>, Action<T>)
public static void ForEach<T>(List<T> collection, Action<T> action)
Parameters
Type Parameters
T
ForEach<T>(T[], Action<T>)
public static void ForEach<T>(T[] collection, Action<T> action)
Parameters
collection
T[]action
Action<T>
Type Parameters
T
ForEach<T, TLocal>(ConcurrentCollector<T>, Func<TLocal>, Action<T, TLocal>, Action<TLocal>)
public static void ForEach<T, TLocal>(ConcurrentCollector<T> collection, Func<TLocal> initializeLocal, Action<T, TLocal> action, Action<TLocal> finalizeLocal = null)
Parameters
collection
ConcurrentCollector<T>initializeLocal
Func<TLocal>action
Action<T, TLocal>finalizeLocal
Action<TLocal>
Type Parameters
T
TLocal
ForEach<TKey, TValue>(Dictionary<TKey, TValue>, Action<KeyValuePair<TKey, TValue>>)
public static void ForEach<TKey, TValue>(Dictionary<TKey, TValue> collection, Action<KeyValuePair<TKey, TValue>> action)
Parameters
collection
Dictionary<TKey, TValue>action
Action<KeyValuePair<TKey, TValue>>
Type Parameters
TKey
TValue
ForEach<T, TList>(TList, Action<T>)
public static void ForEach<T, TList>(TList collection, Action<T> action) where TList : IReadOnlyList<T>
Parameters
collection
TListaction
Action<T>
Type Parameters
T
TList
ForEach<TKey, TValue, TLocal>(Dictionary<TKey, TValue>, Func<TLocal>, Action<KeyValuePair<TKey, TValue>, TLocal>, Action<TLocal>)
public static void ForEach<TKey, TValue, TLocal>(Dictionary<TKey, TValue> collection, Func<TLocal> initializeLocal, Action<KeyValuePair<TKey, TValue>, TLocal> action, Action<TLocal> finalizeLocal = null)
Parameters
collection
Dictionary<TKey, TValue>initializeLocal
Func<TLocal>action
Action<KeyValuePair<TKey, TValue>, TLocal>finalizeLocal
Action<TLocal>
Type Parameters
TKey
TValue
TLocal
ForEach<TItem, TLocal, TList>(TList, Func<TLocal>, Action<TItem, TLocal>, Action<TLocal>)
public static void ForEach<TItem, TLocal, TList>(TList collection, Func<TLocal> initializeLocal, Action<TItem, TLocal> action, Action<TLocal> finalizeLocal = null) where TList : IReadOnlyList<TItem>
Parameters
collection
TListinitializeLocal
Func<TLocal>action
Action<TItem, TLocal>finalizeLocal
Action<TLocal>
Type Parameters
TItem
TLocal
TList
For<TLocal>(int, int, Func<TLocal>, Action<int, TLocal>, Action<TLocal>)
public static void For<TLocal>(int fromInclusive, int toExclusive, Func<TLocal> initializeLocal, Action<int, TLocal> action, Action<TLocal> finalizeLocal = null)
Parameters
fromInclusive
inttoExclusive
intinitializeLocal
Func<TLocal>action
Action<int, TLocal>finalizeLocal
Action<TLocal>
Type Parameters
TLocal
Sort<T>(FastList<T>, IComparer<T>)
public static void Sort<T>(FastList<T> collection, IComparer<T> comparer)
Parameters
Type Parameters
T
Sort<T>(ConcurrentCollector<T>, IComparer<T>)
public static void Sort<T>(ConcurrentCollector<T> collection, IComparer<T> comparer)
Parameters
collection
ConcurrentCollector<T>comparer
IComparer<T>
Type Parameters
T
Sort<T>(T[], int, int, IComparer<T>)
public static void Sort<T>(T[] collection, int index, int length, IComparer<T> comparer)
Parameters
Type Parameters
T