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

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.111 by dl, Thu Jan 26 00:08:13 2012 UTC vs.
Revision 1.112 by dl, Thu Jan 26 18:15:12 2012 UTC

# Line 5 | Line 5
5   */
6  
7   package jsr166y;
8 +
9   import java.util.ArrayList;
10   import java.util.Arrays;
11   import java.util.Collection;
# Line 179 | Line 180 | public class ForkJoinPool extends Abstra
180       * progress, it suffices for any in-progress poll or new push on
181       * any empty queue to complete.
182       *
183 <     * This approach also enables support a user mode in which local
183 >     * This approach also enables support of a user mode in which local
184       * task processing is in FIFO, not LIFO order, simply by using
185       * poll rather than pop.  This can be useful in message-passing
186       * frameworks in which tasks are never joined.  However neither
# Line 206 | Line 207 | public class ForkJoinPool extends Abstra
207       * avoid imbalance.  Insertion of tasks in shared mode requires a
208       * lock (mainly to protect in the case of resizing) but we use
209       * only a simple spinlock (using bits in field runState), because
210 <     * submitters encountering a busy queue try others so never block.
210 >     * submitters encountering a busy queue try or create others so
211 >     * never block.
212       *
213       * Management.
214       * ==========
# Line 297 | Line 299 | public class ForkJoinPool extends Abstra
299       * some other queued worker rather than itself, which has the same
300       * net effect. Because enqueued workers may actually be rescanning
301       * rather than waiting, we set and clear the "parker" field of
302 <     * Workqueues to reduce unnecessary calls to unpark.  (this
302 >     * Workqueues to reduce unnecessary calls to unpark.  (This
303       * requires a secondary recheck to avoid missed signals.)  Note
304       * the unusual conventions about Thread.interrupts surrounding
305       * parking and other blocking: Because interrupts are used solely
# Line 744 | Line 746 | public class ForkJoinPool extends Abstra
746           * be resized
747           */
748          final void push(ForkJoinTask<?> task, ForkJoinPool p) {
747            boolean signal = false;
749              ForkJoinTask<?>[] a;
750              int s = top, m, n;
751              if ((a = array) != null) {    // ignore if queue removed
# Line 1651 | Line 1652 | public class ForkJoinPool extends Abstra
1652      }
1653  
1654      /**
1655 <     * Returns a non-empty steal queue, if is found during a random,
1655 >     * Returns a non-empty steal queue, if one is found during a random,
1656       * then cyclic scan, else null.  This method must be retried by
1657       * caller if, by the time it tries to use the queue, it is empty.
1658       */
# Line 2648 | Line 2649 | a     *  <pre> {@code
2649              }
2650          }
2651      }
2652 +
2653   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines