Package pabeles.concurrency
Class IntObjectTask<T>
java.lang.Object
java.util.concurrent.ForkJoinTask<java.lang.Void>
pabeles.concurrency.IntObjectTask<T>
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.Future<java.lang.Void>
public class IntObjectTask<T>
extends java.util.concurrent.ForkJoinTask<java.lang.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()java.lang.VoidgetRawResult()protected voidsetRawResult(java.lang.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
public java.lang.Void getRawResult()- Specified by:
getRawResultin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-
setRawResult
protected void setRawResult(java.lang.Void value)- Specified by:
setRawResultin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-
exec
protected boolean exec()- Specified by:
execin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-