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 boolean exec()  
    java.lang.Void getRawResult()  
    protected void setRawResult​(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 positive
      maxThreads - The number of threads it can spawn
      whichThread - 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:
      getRawResult in class java.util.concurrent.ForkJoinTask<java.lang.Void>
    • setRawResult

      protected void setRawResult​(java.lang.Void value)
      Specified by:
      setRawResult in class java.util.concurrent.ForkJoinTask<java.lang.Void>
    • exec

      protected boolean exec()
      Specified by:
      exec in class java.util.concurrent.ForkJoinTask<java.lang.Void>