ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/RecursiveAction.java
(Generate patch)

Comparing jsr166/src/jsr166y/RecursiveAction.java (file contents):
Revision 1.7 by jsr166, Mon Jul 27 03:33:28 2009 UTC vs.
Revision 1.12 by dl, Tue Aug 4 22:47:08 2009 UTC

# Line 7 | Line 7
7   package jsr166y;
8  
9   /**
10 < * Recursive resultless ForkJoinTasks. This class establishes
11 < * conventions to parameterize resultless actions as {@code Void}
12 < * ForkJoinTasks. Because {@code null} is the only valid value of
13 < * type {@code Void}, methods such as join always return {@code null}
14 < * upon completion.
10 > * A recursive resultless {@link ForkJoinTask}.  This class
11 > * establishes conventions to parameterize resultless actions as
12 > * {@code Void} {@code ForkJoinTask}s. Because {@code null} is the
13 > * only valid value of type {@code Void}, methods such as join always
14 > * return {@code null} upon completion.
15   *
16   * <p><b>Sample Usages.</b> Here is a sketch of a ForkJoin sort that
17   * sorts a given {@code long[]} array:
# Line 64 | Line 64 | package jsr166y;
64   * of each element of a double array, by subdividing out only the
65   * right-hand-sides of repeated divisions by two, and keeping track of
66   * them with a chain of {@code next} references. It uses a dynamic
67 < * threshold based on method {@code surplus}, but counterbalances
68 < * potential excess partitioning by directly performing leaf actions
69 < * on unstolen tasks rather than further subdividing.
67 > * threshold based on method {@code getSurplusQueuedTaskCount}, but
68 > * counterbalances potential excess partitioning by directly
69 > * performing leaf actions on unstolen tasks rather than further
70 > * subdividing.
71   *
72   *  <pre> {@code
73   * double sumOfSquares(ForkJoinPool pool, double[] array) {
# Line 98 | Line 99 | package jsr166y;
99   *     int l = lo;
100   *     int h = hi;
101   *     Applyer right = null;
102 < *     while (h - l > 1 &&
102 < *        ForkJoinWorkerThread.getEstimatedSurplusTaskCount() <= 3) {
102 > *     while (h - l > 1 && getSurplusQueuedTaskCount() <= 3) {
103   *        int mid = (l + h) >>> 1;
104   *        right = new Applyer(array, mid, h, seqSize, right);
105   *        right.fork();
# Line 123 | Line 123 | package jsr166y;
123   * @author Doug Lea
124   */
125   public abstract class RecursiveAction extends ForkJoinTask<Void> {
126 +    private static final long serialVersionUID = 5232453952276485070L;
127  
128      /**
129       * The main computation performed by this task.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines