Edit

Share via


ParallelHelper.ForEach Method

Definition

Overloads

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory2D<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory2D<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory2D<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory2D<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(Memory<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<TItem> memory, in TAction action, int minimumActionsPerThread) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'Item> * 'Action * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory2D(Of TItem), ByRef action As TAction, minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory2D<TItem>

The input ReadOnlyMemory2D<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(Memory2D<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.Memory2D<TItem> memory, in TAction action, int minimumActionsPerThread) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.Memory2D<'Item> * 'Action * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory2D(Of TItem), ByRef action As TAction, minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IRefAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory2D<TItem>

The input Memory2D<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (ReadOnlyMemory<TItem> memory, in TAction action) where TAction : struct;
static member ForEach : ReadOnlyMemory<'Item> * 'Action -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory(Of TItem), ByRef action As TAction)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory<TItem>

The input ReadOnlyMemory<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (ReadOnlyMemory<TItem> memory, int minimumActionsPerThread) where TAction : struct;
static member ForEach : ReadOnlyMemory<'Item> * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory(Of TItem), minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory<TItem>

The input ReadOnlyMemory<T> representing the data to process.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(Memory<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Memory<TItem> memory, in TAction action) where TAction : struct;
static member ForEach : Memory<'Item> * 'Action -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory(Of TItem), ByRef action As TAction)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory<TItem>

The input Memory<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

Applies to

ForEach<TItem,TAction>(Memory<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Memory<TItem> memory, int minimumActionsPerThread) where TAction : struct;
static member ForEach : Memory<'Item> * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory(Of TItem), minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory<TItem>

The input Memory<T> representing the data to process.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<TItem> memory, in TAction action) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'Item> * 'Action -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory2D(Of TItem), ByRef action As TAction)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory2D<TItem>

The input ReadOnlyMemory2D<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

Applies to

ForEach<TItem,TAction>(Memory2D<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.Memory2D<TItem> memory, int minimumActionsPerThread) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.Memory2D<'Item> * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory2D(Of TItem), minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IRefAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory2D<TItem>

The input Memory2D<T> representing the data to process.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(Memory2D<TItem>, TAction)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.Memory2D<TItem> memory, in TAction action) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.Memory2D<'Item> * 'Action -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory2D(Of TItem), ByRef action As TAction)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IRefAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory2D<TItem>

The input Memory2D<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (ReadOnlyMemory<TItem> memory) where TAction : struct;
static member ForEach : ReadOnlyMemory<'Item> -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory(Of TItem))

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory<TItem>

The input ReadOnlyMemory<T> representing the data to process.

Applies to

ForEach<TItem,TAction>(Memory<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Memory<TItem> memory) where TAction : struct;
static member ForEach : Memory<'Item> -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory(Of TItem))

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IRefAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory<TItem>

The input Memory<T> representing the data to process.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<TItem> memory) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'Item> -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory2D(Of TItem))

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory2D<TItem>

The input ReadOnlyMemory2D<T> representing the data to process.

Applies to

ForEach<TItem,TAction>(Memory2D<TItem>)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.Memory2D<TItem> memory) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.Memory2D<'Item> -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory2D(Of TItem))

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IRefAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory2D<TItem>

The input Memory2D<T> representing the data to process.

Applies to

ForEach<TItem,TAction>(Memory<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Memory<TItem> memory, in TAction action, int minimumActionsPerThread) where TAction : struct;
static member ForEach : Memory<'Item> * 'Action * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As Memory(Of TItem), ByRef action As TAction, minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
Memory<TItem>

The input Memory<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory2D<TItem>, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<TItem> memory, int minimumActionsPerThread) where TAction : struct;
static member ForEach : Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'Item> * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory2D(Of TItem), minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory2D<TItem>

The input ReadOnlyMemory2D<T> representing the data to process.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to

ForEach<TItem,TAction>(ReadOnlyMemory<TItem>, TAction, Int32)

Executes a specified action in an optimized parallel loop over the input data.

public static void ForEach<TItem,TAction> (ReadOnlyMemory<TItem> memory, in TAction action, int minimumActionsPerThread) where TAction : struct;
static member ForEach : ReadOnlyMemory<'Item> * 'Action * int -> unit (requires 'Action : struct)
Public Shared Sub ForEach(Of TItem, TAction) (memory As ReadOnlyMemory(Of TItem), ByRef action As TAction, minimumActionsPerThread As Integer)

Type Parameters

TItem

The type of items to iterate over.

TAction

The type of action (implementing IInAction<T> of TItem) to invoke over each item.

Parameters

memory
ReadOnlyMemory<TItem>

The input ReadOnlyMemory<T> representing the data to process.

action
TAction

The TAction instance representing the action to invoke.

minimumActionsPerThread
Int32

The minimum number of actions to run per individual thread. Set to 1 if all invocations should be parallelized, or to a greater number if each individual invocation is fast enough that it is more efficient to set a lower bound per each running thread.

Applies to