Table of Contents

Class CMSParallel

Namespace
CMS.Base
Assembly
CMS.Base.dll

Wrapper for a Parallel class, providing additional operations to make threads compatible with CMS API (such as CMSThread class)

public class CMSParallel
Inheritance
object
CMSParallel
Extension Methods

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

source ICollection<TSource>

Parallel sources

body Action<TSource>

Executing body

options ParallelOptions

Options 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

source IEnumerable<TSource>

Parallel sources

body Action<TSource>

Executing body

options ParallelOptions

Options for executing

count int

Number 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

source IList<TSource>

Parallel sources

body Action<TSource>

Executing body

options ParallelOptions

Options 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

source TSource[]

Parallel sources

body Action<TSource>

Executing body

options ParallelOptions

Options for executing

Returns

ParallelLoopResult

Type Parameters

TSource