public final class Parallel<R> extends Object
The operation is given unique context information each time it is executed, showing an assignment to the executing thread, the absolute start order, and repetition within the executing thread.
| Modifier and Type | Method and Description |
|---|---|
static <R> Report<R> |
report(int numberOfThreads,
XFunction<Context,R,?> operation)
Returns a
Report after executing a particular operation multiple times in parallel. |
static <R> Stream<R> |
stream(int numberOfThreads,
XFunction<Context,R,?> operation)
Returns a
Stream of results after executing a particular operation multiple times in parallel. |
public static <R> Report<R> report(int numberOfThreads, XFunction<Context,R,?> operation)
Report after executing a particular operation multiple times in parallel.
The operation is executed at least once by each of the designated threads and is repeated until all threads have actually started.
R - The type of result of the operation to be performed.numberOfThreads - The number of parallel threads in which the operation should be performed.operation - The operation to be performed.public static <R> Stream<R> stream(int numberOfThreads, XFunction<Context,R,?> operation) throws Exception
Stream of results after executing a particular operation multiple times in parallel.
The operation is executed at least once by each of the designated threads and is repeated until all threads have actually started.
R - The type of result of the operation to be performed.numberOfThreads - The number of parallel threads in which the operation should be performed.operation - The operation to be performed.Exception - If any Exception occurs while executing the OperationCopyright © 2024 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.