Package pabeles.concurrency
Class IntObjectTask<T>
- All Implemented Interfaces:
Serializable
,Future<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:
-
Constructor Summary
ConstructorDescriptionIntObjectTask
(int idx0, int idx1, int step, int maxThreads, int whichThread, GrowArray<T> workspace, IntObjectConsumer<T> consumer) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
exec()
protected void
setRawResult
(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:
getRawResult
in classForkJoinTask<Void>
-
setRawResult
- Specified by:
setRawResult
in classForkJoinTask<Void>
-
exec
protected boolean exec()- Specified by:
exec
in classForkJoinTask<Void>
-