groovyx.gpars.extra166y
Class PAS.FJBase

java.lang.Object
  extended by jsr166y.ForkJoinTask<java.lang.Void>
      extended by jsr166y.RecursiveAction
          extended by groovyx.gpars.extra166y.PAS.FJBase
All Implemented Interfaces:
java.io.Serializable, java.util.concurrent.Future<java.lang.Void>
Direct Known Subclasses:
PAS.FJCountSelected, PAS.FJDApply, PAS.FJDBinaryIndexMap, PAS.FJDCombineInPlace, PAS.FJDFill, PAS.FJDGenerate, PAS.FJDIndexMap, PAS.FJDMap, PAS.FJDPACombineInPlace, PAS.FJDReduce, PAS.FJDStats, PAS.FJDTransform, PAS.FJDUniquifier, PAS.FJLApply, PAS.FJLBinaryIndexMap, PAS.FJLCombineInPlace, PAS.FJLFill, PAS.FJLGenerate, PAS.FJLIndexMap, PAS.FJLMap, PAS.FJLPACombineInPlace, PAS.FJLReduce, PAS.FJLStats, PAS.FJLTransform, PAS.FJLUniquifier, PAS.FJOApply, PAS.FJOBinaryIndexMap, PAS.FJOCombineInPlace, PAS.FJOFill, PAS.FJOGenerate, PAS.FJOIndexMap, PAS.FJOMap, PAS.FJOPACombineInPlace, PAS.FJOReduce, PAS.FJOStats, PAS.FJOTransform, PAS.FJOUniquifier
Enclosing class:
PAS

abstract static class PAS.FJBase
extends jsr166y.RecursiveAction

Base for most divide-and-conquer tasks used for computing ParallelArray operations. Rather than pure recursion, it links right-hand-sides and then joins up the tree, exploiting cases where tasks aren't stolen. This generates and joins tasks with a bit less overhead than pure recursive style -- there are only as many tasks as leaves (no strictly internal nodes). Split control relies on pap.getThreshold(), which is expected to err on the side of generating too many tasks. To counterbalance, if a task pops off its own smallest subtask, it directly runs its leaf action rather than possibly resplitting. There are, with a few exceptions, three flavors of each FJBase subclass, prefixed FJO (object reference), FJD (double) and FJL (long).


Field Summary
(package private)  int hi
           
(package private)  int lo
           
(package private)  PAS.FJBase next
           
(package private)  AbstractParallelAnyArray pap
           
 
Constructor Summary
PAS.FJBase(AbstractParallelAnyArray pap, int lo, int hi, PAS.FJBase next)
           
 
Method Summary
(package private) abstract  void atLeaf(int l, int h)
          Leaf computation
 void compute()
           
(package private)  void internalCompute(int l, int h, int g)
           
(package private) abstract  PAS.FJBase newSubtask(int l, int h, PAS.FJBase r)
          Factory method to create new subtask, normally of current type
(package private)  void onReduce(PAS.FJBase right)
          Operation performed after joining right subtask -- default noop
 
Methods inherited from class jsr166y.RecursiveAction
exec, getRawResult, setRawResult
 
Methods inherited from class jsr166y.ForkJoinTask
adapt, adapt, adapt, cancel, complete, completeExceptionally, fork, get, get, getException, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyInvoke, quietlyJoin, reinitialize, tryUnfork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pap

final AbstractParallelAnyArray pap

lo

final int lo

hi

final int hi

next

final PAS.FJBase next
Constructor Detail

PAS.FJBase

PAS.FJBase(AbstractParallelAnyArray pap,
           int lo,
           int hi,
           PAS.FJBase next)
Method Detail

compute

public final void compute()
Specified by:
compute in class jsr166y.RecursiveAction

internalCompute

final void internalCompute(int l,
                           int h,
                           int g)

atLeaf

abstract void atLeaf(int l,
                     int h)
Leaf computation


onReduce

void onReduce(PAS.FJBase right)
Operation performed after joining right subtask -- default noop


newSubtask

abstract PAS.FJBase newSubtask(int l,
                               int h,
                               PAS.FJBase r)
Factory method to create new subtask, normally of current type


Copyright © 2008–2012 Václav Pech. All Rights Reserved.