Class Dispatcher
public static class Dispatcher
- Inheritance
-
objectDispatcher
Properties
MaxDegreeOfParallelism
public static int MaxDegreeOfParallelism { get; set; }
Property 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
itemsintThe 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 batchbatchJobTJobAn 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
collectionFastCollection<T>actionAction<T>
Type Parameters
T
ForEach<T>(ConcurrentCollector<T>, ValueAction<T>)
public static void ForEach<T>(ConcurrentCollector<T> collection, Dispatcher.ValueAction<T> action)
Parameters
collectionConcurrentCollector<T>actionDispatcher.ValueAction<T>
Type Parameters
T
ForEach<T>(ConcurrentCollector<T>, Action<T>)
public static void ForEach<T>(ConcurrentCollector<T> collection, Action<T> action)
Parameters
collectionConcurrentCollector<T>actionAction<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
collectionT[]actionAction<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
collectionConcurrentCollector<T>initializeLocalFunc<TLocal>actionAction<T, TLocal>finalizeLocalAction<TLocal>
Type Parameters
TTLocal
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) where TKey : notnull
Parameters
collectionDictionary<TKey, TValue>actionAction<KeyValuePair<TKey, TValue>>
Type Parameters
TKeyTValue
ForEach<T, TList>(TList, Action<T>)
public static void ForEach<T, TList>(TList collection, Action<T> action) where TList : IReadOnlyList<T>
Parameters
collectionTListactionAction<T>
Type Parameters
TTList
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) where TKey : notnull
Parameters
collectionDictionary<TKey, TValue>initializeLocalFunc<TLocal>actionAction<KeyValuePair<TKey, TValue>, TLocal>finalizeLocalAction<TLocal>
Type Parameters
TKeyTValueTLocal
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
collectionTListinitializeLocalFunc<TLocal>actionAction<TItem, TLocal>finalizeLocalAction<TLocal>
Type Parameters
TItemTLocalTList
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
fromInclusiveinttoExclusiveintinitializeLocalFunc<TLocal>actionAction<int, TLocal>finalizeLocalAction<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
collectionConcurrentCollector<T>comparerIComparer<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