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.67 by jsr166, Wed Sep 1 03:32:03 2010 UTC vs.
Revision 1.69 by jsr166, Wed Sep 1 20:12:39 2010 UTC

# Line 157 | Line 157 | public class ForkJoinPool extends Abstra
157       *      links to try to find such a task.
158       *
159       *   Compensating: Unless there are already enough live threads,
160 <     *      method helpMaintainParallelism() may create or or
160 >     *      method helpMaintainParallelism() may create or
161       *      re-activate a spare thread to compensate for blocked
162       *      joiners until they unblock.
163       *
# Line 318 | Line 318 | public class ForkJoinPool extends Abstra
318       * exactly #parallelism threads running, which is an impossible
319       * task. We always need to create one when the number of running
320       * threads would become zero and all workers are busy. Beyond
321 <     * this, we must rely on heuristics that work well in the the
322 <     * presence of transients phenomena such as GC stalls, dynamic
321 >     * this, we must rely on heuristics that work well in the
322 >     * presence of transient phenomena such as GC stalls, dynamic
323       * compilation, and wake-up lags. These transients are extremely
324       * common -- we are normally trying to fully saturate the CPUs on
325       * a machine, so almost any activity other than running tasks
# Line 346 | Line 346 | public class ForkJoinPool extends Abstra
346       * "while ((local = field) != 0)") which are usually the simplest
347       * way to ensure the required read orderings (which are sometimes
348       * critical). Also several occurrences of the unusual "do {}
349 <     * while(!cas...)" which is the simplest way to force an update of
349 >     * while (!cas...)" which is the simplest way to force an update of
350       * a CAS'ed variable. There are also other coding oddities that
351       * help some methods perform reasonably even when interpreted (not
352       * compiled), at the expense of some messy constructions that
# Line 832 | Line 832 | public class ForkJoinPool extends Abstra
832              UNSAFE.compareAndSwapInt(this, spareWaitersOffset,
833                                       sw, w.nextSpare)) {
834              int c; // increment running count before resume
835 <            do {} while(!UNSAFE.compareAndSwapInt
836 <                        (this, workerCountsOffset,
837 <                         c = workerCounts, c + ONE_RUNNING));
835 >            do {} while (!UNSAFE.compareAndSwapInt
836 >                         (this, workerCountsOffset,
837 >                          c = workerCounts, c + ONE_RUNNING));
838              if (w.tryUnsuspend())
839                  LockSupport.unpark(w);
840              else   // back out if w was shutdown
# Line 985 | Line 985 | public class ForkJoinPool extends Abstra
985                      w.lastEventCount = ec;     // no need to wait
986                      break;
987                  }
988 <                else if (!(inactivate |= active))  
988 >                else if (!(inactivate |= active))
989                      eventSync(w, wec);         // must inactivate before sync
990              }
991              else
# Line 1721 | Line 1721 | public class ForkJoinPool extends Abstra
1721          throws InterruptedException {
1722          try {
1723              return termination.awaitAdvanceInterruptibly(0, timeout, unit) > 0;
1724 <        } catch(TimeoutException ex) {
1724 >        } catch (TimeoutException ex) {
1725              return false;
1726          }
1727      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines