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.28 by jsr166, Mon Jul 27 20:57:44 2009 UTC vs.
Revision 1.29 by jsr166, Mon Jul 27 21:41:53 2009 UTC

# Line 20 | Line 20 | import java.util.concurrent.atomic.Atomi
20   import java.util.concurrent.atomic.AtomicLong;
21  
22   /**
23 < * An {@link ExecutorService} for running {@link ForkJoinTask}s.  A
24 < * ForkJoinPool provides the entry point for submissions from
23 > * An {@link ExecutorService} for running {@link ForkJoinTask}s.
24 > * A ForkJoinPool provides the entry point for submissions from
25   * non-ForkJoinTasks, as well as management and monitoring operations.
26   * Normally a single ForkJoinPool is used for a large number of
27   * submitted tasks. Otherwise, use would not usually outweigh the
# Line 34 | Line 34 | import java.util.concurrent.atomic.Atomi
34   * (eventually blocking if none exist). This makes them efficient when
35   * most tasks spawn other subtasks (as do most ForkJoinTasks), as well
36   * as the mixed execution of some plain Runnable- or Callable- based
37 < * activities along with ForkJoinTasks. When setting
38 < * {@code setAsyncMode}, a ForkJoinPools may also be appropriate for
39 < * use with fine-grained tasks that are never joined. Otherwise, other
40 < * ExecutorService implementations are typically more appropriate
41 < * choices.
37 > * activities along with ForkJoinTasks. When setting {@linkplain
38 > * #setAsyncMode async mode}, a ForkJoinPool may also be appropriate
39 > * for use with fine-grained tasks that are never joined. Otherwise,
40 > * other ExecutorService implementations are typically more
41 > * appropriate choices.
42   *
43   * <p>A ForkJoinPool may be constructed with a given parallelism level
44   * (target pool size), which it attempts to maintain by dynamically
45   * adding, suspending, or resuming threads, even if some tasks are
46   * waiting to join others. However, no such adjustments are performed
47   * in the face of blocked IO or other unmanaged synchronization. The
48 < * nested {@code ManagedBlocker} interface enables extension of
48 > * nested {@link ManagedBlocker} interface enables extension of
49   * the kinds of synchronization accommodated.  The target parallelism
50 < * level may also be changed dynamically ({@code setParallelism})
50 > * level may also be changed dynamically ({@link #setParallelism})
51   * and thread construction can be limited using methods
52 < * {@code setMaximumPoolSize} and/or
53 < * {@code setMaintainsParallelism}.
52 > * {@link #setMaximumPoolSize} and/or
53 > * {@link #setMaintainsParallelism}.
54   *
55   * <p>In addition to execution and lifecycle control methods, this
56   * class provides status check methods (for example
57 < * {@code getStealCount}) that are intended to aid in developing,
57 > * {@link #getStealCount}) that are intended to aid in developing,
58   * tuning, and monitoring fork/join applications. Also, method
59 < * {@code toString} returns indications of pool state in a
59 > * {@link #toString} returns indications of pool state in a
60   * convenient form for informal monitoring.
61   *
62   * <p><b>Implementation notes</b>: This implementation restricts the
# Line 815 | Line 815 | public class ForkJoinPool extends Abstra
815      /**
816       * Returns the number of worker threads that have started but not
817       * yet terminated.  This result returned by this method may differ
818 <     * from {@code getParallelism} when threads are created to
818 >     * from {@link #getParallelism} when threads are created to
819       * maintain parallelism when others are cooperatively blocked.
820       *
821       * @return the number of worker threads
# Line 877 | Line 877 | public class ForkJoinPool extends Abstra
877       * tasks that are never joined. This mode may be more appropriate
878       * than default locally stack-based mode in applications in which
879       * worker threads only process asynchronous tasks.  This method is
880 <     * designed to be invoked only when pool is quiescent, and
880 >     * designed to be invoked only when the pool is quiescent, and
881       * typically only before any tasks are submitted. The effects of
882       * invocations at other times may be unpredictable.
883       *
884 <     * @param async if true, use locally FIFO scheduling
884 >     * @param async if {@code true}, use locally FIFO scheduling
885       * @return the previous mode
886 +     * @see #getAsyncMode
887       */
888      public boolean setAsyncMode(boolean async) {
889          boolean oldMode = locallyFifo;
# Line 903 | Line 904 | public class ForkJoinPool extends Abstra
904       * scheduling mode for forked tasks that are never joined.
905       *
906       * @return {@code true} if this pool uses async mode
907 +     * @see #setAsyncMode
908       */
909      public boolean getAsyncMode() {
910          return locallyFifo;
# Line 1131 | Line 1133 | public class ForkJoinPool extends Abstra
1133       * method may or may not be rejected. Unlike some other executors,
1134       * this method cancels rather than collects non-executed tasks
1135       * upon termination, so always returns an empty list. However, you
1136 <     * can use method {@code drainTasksTo} before invoking this
1136 >     * can use method {@link #drainTasksTo} before invoking this
1137       * method to transfer unexecuted tasks to another collection.
1138       *
1139       * @return an empty list

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines