Parallel Parallel Parallel Parallel Class

Definition

Unterstützt parallele Schleifen und Bereiche.Provides support for parallel loops and regions.

public ref class Parallel abstract sealed
public static class Parallel
type Parallel = class
Public Class Parallel
Vererbung
ParallelParallelParallelParallel

Beispiele

In diesem Beispiel werden mehrere Ansätze zum Implementieren einer parallelen Schleife mithilfe mehrerer Sprachkonstrukte veranschaulicht.This example demonstrates several approaches to implementing a parallel loop using multiple language constructs.

using System.Threading.Tasks;   
class Test
{
    static int N = 1000;

    static void TestMethod()
    {
        // Using a named method.
        Parallel.For(0, N, Method2);

        // Using an anonymous method.
        Parallel.For(0, N, delegate(int i)
        {
            // Do Work.
        });

        // Using a lambda expression.
        Parallel.For(0, N, i =>
        {
            // Do Work.
        });
    }

    static void Method2(int i)
    {
        // Do work.
    }
}
Imports System.Threading.Tasks

Module Module1

    Sub Main()
        Dim N As Integer = 1000

        ' Using a named method
        Parallel.For(0, N, AddressOf Method2)

        ' Using a lambda expression.
        Parallel.For(0, N, Sub(i)
                               ' Do Work
                           End Sub)
    End Sub

    Sub Method2(ByVal i As Integer)
        ' Do work.
    End Sub

End Module

Hinweise

Die Parallel -Klasse stellt Bibliotheks basierte Daten parallele Ersetzungen für allgemeine Vorgänge bereit, z. b. for-Schleifen, for Each-Schleifen und die Ausführung eines Satzes von-Anweisungen.The Parallel class provides library-based data parallel replacements for common operations such as for loops, for each loops, and execution of a set of statements.

Methoden

For(Int32, Int32, Action<Int32,ParallelLoopState>) For(Int32, Int32, Action<Int32,ParallelLoopState>) For(Int32, Int32, Action<Int32,ParallelLoopState>) For(Int32, Int32, Action<Int32,ParallelLoopState>)

Führt eine for-Schleife aus, in der Iterationen parallel ausgeführt werden können und der Status der Schleife beobachtet und bearbeitet werden kann.Executes a for loop in which iterations may run in parallel and the state of the loop can be monitored and manipulated.

For(Int32, Int32, Action<Int32>) For(Int32, Int32, Action<Int32>) For(Int32, Int32, Action<Int32>) For(Int32, Int32, Action<Int32>)

Führt eine for-Schleife aus, in der Iterationen parallel ausgeführt werden können.Executes a for loop in which iterations may run in parallel.

For(Int64, Int64, Action<Int64,ParallelLoopState>) For(Int64, Int64, Action<Int64,ParallelLoopState>) For(Int64, Int64, Action<Int64,ParallelLoopState>) For(Int64, Int64, Action<Int64,ParallelLoopState>)

Führt eine for-Schleife mit 64-Bit-Indizes aus, in der Iterationen parallel ausgeführt werden können und der Zustand der Schleife überwacht und bearbeitet werden kann.Executes a for loop with 64-bit indexes in which iterations may run in parallel and the state of the loop can be monitored and manipulated.

For(Int64, Int64, Action<Int64>) For(Int64, Int64, Action<Int64>) For(Int64, Int64, Action<Int64>) For(Int64, Int64, Action<Int64>)

Führt eine for-Schleife mit 64-Bit-Indizes aus, in der Iterationen parallel ausgeführt werden können.Executes a for loop with 64-bit indexes in which iterations may run in parallel.

For(Int32, Int32, ParallelOptions, Action<Int32,ParallelLoopState>) For(Int32, Int32, ParallelOptions, Action<Int32,ParallelLoopState>) For(Int32, Int32, ParallelOptions, Action<Int32,ParallelLoopState>) For(Int32, Int32, ParallelOptions, Action<Int32,ParallelLoopState>)

Führt eine for-Schleife aus, in der Iterationen parallel ausgeführt und Schleifenoptionen konfiguriert werden können und wo der Status der Schleife beobachtet und bearbeitet werden kann.Executes a for loop in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

For(Int32, Int32, ParallelOptions, Action<Int32>) For(Int32, Int32, ParallelOptions, Action<Int32>) For(Int32, Int32, ParallelOptions, Action<Int32>) For(Int32, Int32, ParallelOptions, Action<Int32>)

Führt eine for-Schleife aus, in der Iterationen parallel ausgeführt und Schleifenoptionen konfiguriert werden können.Executes a for loop in which iterations may run in parallel and loop options can be configured.

For(Int64, Int64, ParallelOptions, Action<Int64,ParallelLoopState>) For(Int64, Int64, ParallelOptions, Action<Int64,ParallelLoopState>) For(Int64, Int64, ParallelOptions, Action<Int64,ParallelLoopState>) For(Int64, Int64, ParallelOptions, Action<Int64,ParallelLoopState>)

Führt eine for-Schleife mit 64-Bit-Indizes aus, in der Iterationen parallel ausgeführt und Schleifenoptionen konfiguriert werden können, und der Status der Schleife kann beobachtet und bearbeitet werden.Executes a for loop with 64-bit indexes in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

For(Int64, Int64, ParallelOptions, Action<Int64>) For(Int64, Int64, ParallelOptions, Action<Int64>) For(Int64, Int64, ParallelOptions, Action<Int64>) For(Int64, Int64, ParallelOptions, Action<Int64>)

Führt eine for-Schleife mit 64-Bit-Indizes aus, in der Iterationen parallel ausgeführt und Schleifenoptionen konfiguriert werden können.Executes a for loop with 64-bit indexes in which iterations may run in parallel and loop options can be configured.

For<TLocal>(Int64, Int64, ParallelOptions, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int64, Int64, ParallelOptions, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int64, Int64, ParallelOptions, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int64, Int64, ParallelOptions, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt eine for-Schleife mit 64-Bit Indizes und Thread-lokalen Daten aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar, und der Schleifenstatus kann beobachtet und manipuliert werden.Executes a for loop with 64-bit indexes and thread-local data in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

For<TLocal>(Int32, Int32, ParallelOptions, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int32, Int32, ParallelOptions, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int32, Int32, ParallelOptions, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int32, Int32, ParallelOptions, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt eine for-Schleife mit lokalen Threaddaten aus, in der Iterationen parallel ausgeführt, Schleifenoptionen konfiguriert und der Status der Schleife beobachtet und bearbeitet werden können.Executes a for loop with thread-local data in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

For<TLocal>(Int32, Int32, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int32, Int32, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int32, Int32, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int32, Int32, Func<TLocal>, Func<Int32,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt eine for-Schleife mit lokalen Threaddaten aus, in der Iterationen parallel ausgeführt und der Status der Schleife beobachtet und bearbeitet werden können.Executes a for loop with thread-local data in which iterations may run in parallel, and the state of the loop can be monitored and manipulated.

For<TLocal>(Int64, Int64, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int64, Int64, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int64, Int64, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) For<TLocal>(Int64, Int64, Func<TLocal>, Func<Int64,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt eine for-Schleife mit 64-Bit-Indizes sowie lokalen Threaddaten aus, in denen Iterationen parallel ausgeführt werden können, und der Status der Schleife kann beobachtet und bearbeitet werden.Executes a for loop with 64-bit indexes and thread-local data in which iterations may run in parallel, and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit threadlokalen Daten für einen IEnumerable aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann überwacht und angepasst werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data on an IEnumerable in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit Thread-lokalen Daten und 64-Bit-Indizes für einen IEnumerable aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data and 64-bit indexes on an IEnumerable in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(Partitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(Partitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(Partitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(Partitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit Thread-lokalen Daten für einen Partitioner aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data on a Partitioner in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, ParallelOptions, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit 64-Bit-Indizes und Thread-lokalen Daten für einen OrderablePartitioner<TSource> aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with 64-bit indexes and with thread-local data on a OrderablePartitioner<TSource> in which iterations may run in parallel , loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit Thread-lokalen Daten für einen IEnumerable aus. Iterationen können parallel ablaufen. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data on an IEnumerable in which iterations may run in parallel, and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(IEnumerable<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit Thread-lokalen Daten für einen IEnumerable aus. Iterationen können parallel ablaufen. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data on an IEnumerable in which iterations may run in parallel and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(Partitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(Partitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(Partitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(Partitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit Thread-lokalen Daten für einen Partitioner aus. Iterationen können parallel ablaufen. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data on a Partitioner in which iterations may run in parallel and the state of the loop can be monitored and manipulated.

ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>) ForEach<TSource,TLocal>(OrderablePartitioner<TSource>, Func<TLocal>, Func<TSource,ParallelLoopState,Int64,TLocal,TLocal>, Action<TLocal>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit Thread-lokalen Daten für einen OrderablePartitioner<TSource> aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with thread-local data on a OrderablePartitioner<TSource> in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem IEnumerable aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar.Executes a foreach (For Each in Visual Basic) operation on an IEnumerable in which iterations may run in parallel and loop options can be configured.

ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem IEnumerable aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation on an IEnumerable in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem IEnumerable aus. Iterationen können parallel ablaufen. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation on an IEnumerable in which iterations may run in parallel, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource>) ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource>) ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource>) ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem Partitioner aus. Iterationen können parallel ausgeführt werden, Schleifenoptionen sind konfigurierbar.Executes a foreach (For Each in Visual Basic) operation on a Partitioner in which iterations may run in parallel and loop options can be configured.

ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>) ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>) ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>) ForEach<TSource>(Partitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem Partitioner aus. Iterationen können parallel ablaufen, Schleifenoptionen sind konfigurierbar, und der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation on a Partitioner in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(OrderablePartitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(OrderablePartitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(OrderablePartitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(OrderablePartitioner<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem OrderablePartitioner<TSource> aus. Iterationen können parallel ablaufen, Schleifenoptionen sind konfigurierbar, und der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation on a OrderablePartitioner<TSource> in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(IEnumerable<TSource>, Action<TSource>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem IEnumerable aus. Iterationen können parallel ablaufen.Executes a foreach (For Each in Visual Basic) operation on an IEnumerable in which iterations may run in parallel.

ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(IEnumerable<TSource>, Action<TSource,ParallelLoopState,Int64>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit 64-Bit-Indizes für einen IEnumerable aus. Iterationen können parallel ausgeführt werden. Der Schleifenzustand kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with 64-bit indexes on an IEnumerable in which iterations may run in parallel, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(Partitioner<TSource>, Action<TSource>) ForEach<TSource>(Partitioner<TSource>, Action<TSource>) ForEach<TSource>(Partitioner<TSource>, Action<TSource>) ForEach<TSource>(Partitioner<TSource>, Action<TSource>)

Führt einen foreach-Vorgang (For Each in Visual Basic) für ein Partitioner-Objekt aus, in dem Iterationen parallel ausgeführt werden können.Executes a foreach (For Each in Visual Basic) operation on a Partitioner in which iterations may run in parallel.

ForEach<TSource>(Partitioner<TSource>, Action<TSource,ParallelLoopState>) ForEach<TSource>(Partitioner<TSource>, Action<TSource,ParallelLoopState>) ForEach<TSource>(Partitioner<TSource>, Action<TSource,ParallelLoopState>) ForEach<TSource>(Partitioner<TSource>, Action<TSource,ParallelLoopState>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem Partitioner aus. Iterationen können parallel ablaufen, und der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation on a Partitioner in which iterations may run in parallel, and the state of the loop can be monitored and manipulated.

ForEach<TSource>(OrderablePartitioner<TSource>, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(OrderablePartitioner<TSource>, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(OrderablePartitioner<TSource>, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(OrderablePartitioner<TSource>, Action<TSource,ParallelLoopState,Int64>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit einem OrderablePartitioner<TSource> aus. Iterationen können parallel ablaufen, und der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation on a OrderablePartitioner<TSource> in which iterations may run in parallel and the state of the loop can be monitored and manipulated.

ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>) ForEach<TSource>(IEnumerable<TSource>, ParallelOptions, Action<TSource,ParallelLoopState,Int64>)

Führt einen foreach-Vorgang (For Each in Visual Basic) mit 64-Bit-Indizes für einen IEnumerable aus. Iterationen können parallel ablaufen. Schleifenoptionen sind konfigurierbar. Der Schleifenstatus kann beobachtet und manipuliert werden.Executes a foreach (For Each in Visual Basic) operation with 64-bit indexes on an IEnumerable in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.

Invoke(Action[]) Invoke(Action[]) Invoke(Action[]) Invoke(Action[])

Führt jede der bereitgestellten Aktionen aus (möglicherweise parallel).Executes each of the provided actions, possibly in parallel.

Invoke(ParallelOptions, Action[]) Invoke(ParallelOptions, Action[]) Invoke(ParallelOptions, Action[]) Invoke(ParallelOptions, Action[])

Führt die einzelnen bereitgestellten Aktionen (nach Möglichkeit parallel) aus, es sei denn, der Vorgang wird vom Benutzer abgebrochen.Executes each of the provided actions, possibly in parallel, unless the operation is cancelled by the user.

Gilt für:

Threadsicherheit

Alle öffentlichen und geschützten Member von Parallel sind Thread sicher und können gleichzeitig von mehreren Threads verwendet werden.All public and protected members of Parallel are thread-safe and may be used concurrently from multiple threads.

Siehe auch