/// <summary>Runs an instance of a work item on each hardware thread, and returns the results from all instances when they've /// completed or been canceled using the given cancellation event. /// </summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelismRemarks/*"/> public static T[] Parallelize <T>(TaskDelegate <T> work, TaskCancellationEvent cancellationEvent) { return(Parallelize(work, SystemInformation.GetAvailableCpuThreads(), cancellationEvent)); }
/// <summary>Runs an instance of a work item on each hardware thread, and returns when all instances have completed or been /// canceled using the given cancellation event. /// </summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelismRemarks/*"/> public static void Parallelize(TaskDelegate work, TaskCancellationEvent cancellationEvent) { Parallelize(work, SystemInformation.GetAvailableCpuThreads(), cancellationEvent); }
/// <summary>Runs an instance of a work item on each hardware thread, and returns the results from all instances they've /// completed. /// </summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelismRemarks/*"/> public static T[] Parallelize <T>(TaskDelegate <T> work) { return(Parallelize(work, SystemInformation.GetAvailableCpuThreads(), null)); }
/// <summary>Runs an instance of a work item on each hardware thread, and returns when all instances have completed.</summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelismRemarks/*"/> public static void Parallelize(TaskDelegate work) { Parallelize(work, SystemInformation.GetAvailableCpuThreads(), null); }
/// <summary>Executes a loop in chunks using the maximum number of hardware threads available.</summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelForChunked/*"/> public static void ParallelFor(int start, int endExclusive, Action <int, int, LoopThreadInfo> body) { ParallelFor(start, endExclusive, body, SystemInformation.GetAvailableCpuThreads()); }
/// <summary>Executes a loop using the maximum number of hardware threads available.</summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelFor/*[not(@name='body')]"/> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelForWithInit/*"/> public static void ParallelFor <T>(int start, int endExclusive, Func <LoopThreadInfo, T> threadInitializer, Action <int, T, LoopThreadInfo> body) { ParallelFor(start, endExclusive, threadInitializer, body, SystemInformation.GetAvailableCpuThreads()); }
/// <summary>Creates and returns a task that represents the running of an instance of a work item on each hardware thread. The /// method accepts an optional cancellation event that can be associated with all instances of the work item, as well as the /// aggregate task that encapsulates them. /// </summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelismRemarks/*"/> public static CompositeTask CreateParallel <T>(TaskDelegate <T> work, TaskCancellationEvent cancellationEvent) { return(CreateParallel(work, SystemInformation.GetAvailableCpuThreads(), cancellationEvent)); }
/// <summary>Creates and returns a task that represents the running of an instance of a work item on each hardware thread.</summary> /// <include file="documentation.xml" path="/Utilities/Tasks/ParallelismRemarks/*"/> public static CompositeTask CreateParallel <T>(TaskDelegate <T> work) { return(CreateParallel(work, SystemInformation.GetAvailableCpuThreads(), null)); }