Package pabeles.concurrency
Class IntObjectTask<T>
- All Implemented Interfaces:
Serializable,Future<Void>
public class IntObjectTask<T> extends ForkJoinTask<Void>
Performs a parallel for loop with the specified step increment and a workspace for each thread. Each thread is
tasked with computing the results for a specified number of iterations and it will be provided the same workspace
for all iterations
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description IntObjectTask(int idx0, int idx1, int step, int maxThreads, int whichThread, GrowArray<T> workspace, IntObjectConsumer<T> consumer) -
Method Summary
Modifier and Type Method Description protected booleanexec()VoidgetRawResult()protected voidsetRawResult(Void value)Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
Constructor Details
-
IntObjectTask
public IntObjectTask(int idx0, int idx1, int step, int maxThreads, int whichThread, GrowArray<T> workspace, IntObjectConsumer<T> consumer)- Parameters:
step- The amount the counter steps each iteration. Must be positivemaxThreads- The number of threads it can spawnwhichThread- If < 0 then it's the master thread otherwise this thread index and specifies which workspace to use
-
-
Method Details
-
getRawResult
- Specified by:
getRawResultin classForkJoinTask<Void>
-
setRawResult
- Specified by:
setRawResultin classForkJoinTask<Void>
-
exec
protected boolean exec()- Specified by:
execin classForkJoinTask<Void>
-