xtd 1.0.0
Loading...
Searching...
No Matches
xtd::threading::tasks::parallel Class Reference
Inheritance diagram for xtd::threading::tasks::parallel:
xtd::static_object

Definition

Provides support for creating and scheduling Task objects.

Namespace
xtd::threading::tasks
Library
xtd.core

Static Public Member Functions

template<xtd::integer integer_t>
static auto for_ (integer_t from_inclusive, integer_t to_exclusive, auto &&body) -> void
template<xtd::integer integer_t>
static auto for_ (integer_t from_inclusive, integer_t to_exclusive, auto &&body, const xtd::threading::cancellation_token &cancellation_token) -> void
template<xtd::integer integer_t>
static auto for_async (integer_t from_inclusive, integer_t to_exclusive, auto &&body) -> xtd::threading::tasks::task<>
template<xtd::integer integer_t>
static auto for_async (integer_t from_inclusive, integer_t to_exclusive, auto &&body, const xtd::threading::cancellation_token &cancellation_token) -> xtd::threading::tasks::task<>
template<xtd::iterable source_t>
static auto for_each (source_t &&source, auto &&body) -> void
template<xtd::iterable source_t>
static auto for_each (source_t &&source, auto &&body, const xtd::threading::cancellation_token &cancellation_token) -> void
template<xtd::iterable source_t>
static auto for_each_async (source_t &&source, auto &&body) -> xtd::threading::tasks::task<>
 Executes a for-each operation on an xtd::iterable in which iterations may run in parallel.
template<xtd::iterable source_t>
static auto for_each_async (source_t &&source, auto &&body, const xtd::threading::cancellation_token &cancellation_token) -> xtd::threading::tasks::task<>
 Executes a for-each operation on an xtd::iterable in which iterations may run in parallel.
static auto invoke (xtd::array< xtd::action<> > &&actions) -> void
 Executes each of the provided actions, possibly in parallel.
template<typename collection_t>
static auto invoke (collection_t &&actions) -> void
 Executes each of the provided actions, possibly in parallel.
template<typename ... args_t>
static auto invoke (args_t &&... args) -> void
 Executes each of the provided actions, possibly in parallel.
static auto invoke_async (xtd::array< xtd::action<> > &&actions) -> xtd::array< xtd::threading::tasks::task<> >
template<typename collection_t>
static auto invoke_async (collection_t &&actions) -> xtd::array< xtd::threading::tasks::task<> >
template<typename ... args_t>
static auto invoke_async (args_t &&... args) -> xtd::array< xtd::threading::tasks::task<> >

Member Function Documentation

◆ for_each_async() [1/2]

template<xtd::iterable source_t>
auto xtd::threading::tasks::parallel::for_each_async ( source_t && source,
auto && body ) -> xtd::threading::tasks::task<>
inlinestatic

Executes a for-each operation on an xtd::iterable in which iterations may run in parallel.

Parameters
sourceAn enumerable data source.
bodyAn asynchronous delegate that is invoked once per element in the data source.
Returns
A task that represents the entire for-each operation.
Remarks
The operation will execute at most ProcessorCount operations in parallel.

◆ for_each_async() [2/2]

template<xtd::iterable source_t>
auto xtd::threading::tasks::parallel::for_each_async ( source_t && source,
auto && body,
const xtd::threading::cancellation_token & cancellation_token ) -> xtd::threading::tasks::task<>
inlinestatic

Executes a for-each operation on an xtd::iterable in which iterations may run in parallel.

Parameters
sourceAn enumerable data source.
bodyAn asynchronous delegate that is invoked once per element in the data source.
cancellation_token
Returns
A task that represents the entire for-each operation.
Remarks
The operation will execute at most ProcessorCount operations in parallel.

◆ invoke() [1/3]

auto xtd::threading::tasks::parallel::invoke ( xtd::array< xtd::action<> > && actions) -> void
inlinestatic

Executes each of the provided actions, possibly in parallel.

Library
Switch.Core
Parameters
Anarray of Action to execute.
Remarks
This method can be used to execute a set of operations, potentially in parallel.
No guarantees are made about the order in which the operations execute or whether they execute in parallel. This method does not return until each of the provided operations has completed, regardless of whether completion occurs due to normal or exceptional termination.
Examples
This example demonstrates how to use the Invokemethod with other methods, anonymous delegates, and lambda expressions.

◆ invoke() [2/3]

template<typename collection_t>
auto xtd::threading::tasks::parallel::invoke ( collection_t && actions) -> void
inlinestatic

Executes each of the provided actions, possibly in parallel.

Library
Switch.Core
Parameters
Anarray of Action to execute.
Remarks
This method can be used to execute a set of operations, potentially in parallel.
No guarantees are made about the order in which the operations execute or whether they execute in parallel. This method does not return until each of the provided operations has completed, regardless of whether completion occurs due to normal or exceptional termination.
Examples
This example demonstrates how to use the Invokemethod with other methods, anonymous delegates, and lambda expressions.

◆ invoke() [3/3]

template<typename ... args_t>
auto xtd::threading::tasks::parallel::invoke ( args_t &&... args) -> void
inlinestatic

Executes each of the provided actions, possibly in parallel.

Library
Switch.Core
Parameters
Anarray of Action to execute.
Remarks
This method can be used to execute a set of operations, potentially in parallel.
No guarantees are made about the order in which the operations execute or whether they execute in parallel. This method does not return until each of the provided operations has completed, regardless of whether completion occurs due to normal or exceptional termination.
Examples
This example demonstrates how to use the Invokemethod with other methods, anonymous delegates, and lambda expressions.

The documentation for this class was generated from the following file: