Class CMSParallel
Wrapper for a Parallel class, providing additional operations to make threads compatible with CMS API (such as CMSThread class)
public class CMSParallel
- Inheritance
-
objectCMSParallel
- Extension Methods
Constructors
CMSParallel()
public CMSParallel()
Methods
ForEach<TSource>(ICollection<TSource>, Action<TSource>, ParallelOptions)
Executes a for each operation on an System.Collections.IEnumerable{TSource} in which iterations may run in parallel. Wraps the operation into CMSThread to ensure proper context.
public static ParallelLoopResult ForEach<TSource>(ICollection<TSource> source, Action<TSource> body, ParallelOptions options)
Parameters
sourceICollection<TSource>Parallel sources
bodyAction<TSource>Executing body
optionsParallelOptionsOptions for executing
Returns
- ParallelLoopResult
Type Parameters
TSource
ForEach<TSource>(IEnumerable<TSource>, Action<TSource>, ParallelOptions, int)
Executes a for each operation on an System.Collections.IEnumerable{TSource} in which iterations may run in parallel. Wraps the operation into CMSThread to ensure proper context.
public static ParallelLoopResult ForEach<TSource>(IEnumerable<TSource> source, Action<TSource> body, ParallelOptions options = null, int count = 2147483647)
Parameters
sourceIEnumerable<TSource>Parallel sources
bodyAction<TSource>Executing body
optionsParallelOptionsOptions for executing
countintNumber of the items that will be executed. If set, optimizes the performance in case there is none or one items in the source.
Returns
- ParallelLoopResult
Type Parameters
TSource
ForEach<TSource>(IList<TSource>, Action<TSource>, ParallelOptions)
Executes a for each operation on an System.Collections.IEnumerable{TSource} in which iterations may run in parallel. Wraps the operation into CMSThread to ensure proper context.
public static ParallelLoopResult ForEach<TSource>(IList<TSource> source, Action<TSource> body, ParallelOptions options)
Parameters
sourceIList<TSource>Parallel sources
bodyAction<TSource>Executing body
optionsParallelOptionsOptions for executing
Returns
- ParallelLoopResult
Type Parameters
TSource
ForEach<TSource>(TSource[], Action<TSource>, ParallelOptions)
Executes a for each operation on an System.Collections.IEnumerable{TSource} in which iterations may run in parallel. Wraps the operation into CMSThread to ensure proper context.
public static ParallelLoopResult ForEach<TSource>(TSource[] source, Action<TSource> body, ParallelOptions options)
Parameters
sourceTSource[]Parallel sources
bodyAction<TSource>Executing body
optionsParallelOptionsOptions for executing
Returns
- ParallelLoopResult
Type Parameters
TSource