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.123 by dl, Mon Feb 20 18:20:06 2012 UTC vs.
Revision 1.126 by jsr166, Tue Feb 21 00:44:53 2012 UTC

# Line 413 | Line 413 | public class ForkJoinPool extends Abstra
413       * unblocked threads to the point that we know they are available)
414       * leading to more situations requiring more threads, and so
415       * on. This aspect of control can be seen as an (analytically
416 <     * intractible) game with an opponent that may choose the worst
416 >     * intractable) game with an opponent that may choose the worst
417       * (for us) active thread to stall at any time.  We take several
418       * precautions to bound losses (and thus bound gains), mainly in
419       * methods tryCompensate and awaitJoin: (1) We only try
# Line 1399 | Line 1399 | public class ForkJoinPool extends Abstra
1399       * range). If no queue exists at the index, one is created.  If
1400       * the queue is busy, another index is randomly chosen. The
1401       * submitMask bounds the effective number of queues to the
1402 <     * (nearest poswer of two for) parallelism level.
1402 >     * (nearest power of two for) parallelism level.
1403       *
1404       * @param task the task. Caller must ensure non-null.
1405       */
# Line 1588 | Line 1588 | public class ForkJoinPool extends Abstra
1588                  else {
1589                      if ((ns = w.nsteals) != 0) {
1590                          w.nsteals = 0;        // set rescans if ran task
1591 <                        w.rescans = (a > 0)? 0 : a + parallelism;
1591 >                        w.rescans = (a > 0) ? 0 : a + parallelism;
1592                          w.totalSteals += ns;
1593                      }
1594                      if (a == 1 - parallelism) // quiescent
# Line 1757 | Line 1757 | public class ForkJoinPool extends Abstra
1757       * adds a new thread if no idle workers are available and either
1758       * pool would become completely starved or: (at least half
1759       * starved, and fewer than 50% spares exist, and there is at least
1760 <     * one task apparently available). Even though the availablity
1760 >     * one task apparently available). Even though the availability
1761       * check requires a full scan, it is worthwhile in reducing false
1762       * alarms.
1763       *
1764 <     * @param task if nonnull, a task being waited for
1765 <     * @param blocker if nonnull, a blocker being waited for
1764 >     * @param task if non-null, a task being waited for
1765 >     * @param blocker if non-null, a blocker being waited for
1766       * @return true if the caller can block, else should recheck and retry
1767       */
1768      final boolean tryCompensate(ForkJoinTask<?> task, ManagedBlocker blocker) {
# Line 1821 | Line 1821 | public class ForkJoinPool extends Abstra
1821      }
1822  
1823      /**
1824 <     * Helps and/or blocks until the given task is done
1824 >     * Helps and/or blocks until the given task is done.
1825       *
1826       * @param joiner the joining worker
1827       * @param task the task

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines