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.74 by jsr166, Tue Sep 7 06:32:45 2010 UTC vs.
Revision 1.77 by dl, Tue Sep 7 14:43:31 2010 UTC

# Line 6 | Line 6
6  
7   package jsr166y;
8  
9 import java.util.concurrent.*;
9   import java.util.ArrayList;
10   import java.util.Arrays;
11   import java.util.Collection;
# Line 429 | Line 428 | public class ForkJoinPool extends Abstra
428  
429      /**
430       * The wakeup interval (in nanoseconds) for the oldest worker
431 <     * waiting for an event invokes tryShutdownUnusedWorker to shrink
432 <     * the number of workers.  The exact value does not matter too
433 <     * much, but should be long enough to slowly release resources
434 <     * during long periods without use without disrupting normal use.
431 >     * waiting for an event to invoke tryShutdownUnusedWorker to
432 >     * shrink the number of workers.  The exact value does not matter
433 >     * too much. It must be short enough to release resources during
434 >     * sustained periods of idleness, but not so short that threads
435 >     * are continually re-created.
436       */
437      private static final long SHRINK_RATE_NANOS =
438          30L * 1000L * 1000L * 1000L; // 2 per minute
# Line 604 | Line 604 | public class ForkJoinPool extends Abstra
604       * (rarely) necessary when other count updates lag.
605       *
606       * @param dr -- either zero or ONE_RUNNING
607 <     * @param dt == either zero or ONE_TOTAL
607 >     * @param dt -- either zero or ONE_TOTAL
608       */
609      private void decrementWorkerCounts(int dr, int dt) {
610          for (;;) {
# Line 1441 | Line 1441 | public class ForkJoinPool extends Abstra
1441  
1442      /**
1443       * Returns the number of worker threads that have started but not
1444 <     * yet terminated.  This result returned by this method may differ
1444 >     * yet terminated.  The result returned by this method may differ
1445       * from {@link #getParallelism} when threads are created to
1446       * maintain parallelism when others are cooperatively blocked.
1447       *
# Line 1842 | Line 1842 | public class ForkJoinPool extends Abstra
1842      private static final long eventCountOffset =
1843          objectFieldOffset("eventCount", ForkJoinPool.class);
1844      private static final long eventWaitersOffset =
1845 <        objectFieldOffset("eventWaiters",ForkJoinPool.class);
1845 >        objectFieldOffset("eventWaiters", ForkJoinPool.class);
1846      private static final long stealCountOffset =
1847 <        objectFieldOffset("stealCount",ForkJoinPool.class);
1847 >        objectFieldOffset("stealCount", ForkJoinPool.class);
1848      private static final long spareWaitersOffset =
1849 <        objectFieldOffset("spareWaiters",ForkJoinPool.class);
1849 >        objectFieldOffset("spareWaiters", ForkJoinPool.class);
1850  
1851      private static long objectFieldOffset(String field, Class<?> klazz) {
1852          try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines