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.38 by jsr166, Sun Aug 2 17:02:06 2009 UTC vs.
Revision 1.39 by jsr166, Sun Aug 2 17:55:51 2009 UTC

# Line 21 | Line 21 | import java.util.concurrent.atomic.Atomi
21  
22   /**
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
28 < * construction and bookkeeping overhead of creating a large set of
29 < * threads.
24 > * A {@code ForkJoinPool} provides the entry point for submissions
25 > * from non-{@code ForkJoinTask}s, as well as management and
26 > * monitoring operations.  Normally a single {@code ForkJoinPool} is
27 > * used for a large number of submitted tasks. Otherwise, use would
28 > * not usually outweigh the construction and bookkeeping overhead of
29 > * creating a large set of threads.
30   *
31 < * <p>ForkJoinPools differ from other kinds of Executors mainly in
32 < * that they provide <em>work-stealing</em>: all threads in the pool
33 < * attempt to find and execute subtasks created by other active tasks
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 {@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
31 > * <p>{@code ForkJoinPool}s differ from other kinds of {@link
32 > * Executor}s mainly in that they provide <em>work-stealing</em>: all
33 > * threads in the pool attempt to find and execute subtasks created by
34 > * other active tasks (eventually blocking if none exist). This makes
35 > * them efficient when most tasks spawn other subtasks (as do most
36 > * {@code ForkJoinTask}s), as well as the mixed execution of some
37 > * plain {@code Runnable}- or {@code Callable}- based activities along
38 > * with {@code ForkJoinTask}s. When setting {@linkplain #setAsyncMode
39 > * async mode}, a {@code ForkJoinPool} may also be appropriate for use
40 > * with fine-grained tasks that are never joined. Otherwise, other
41 > * {@code ExecutorService} implementations are typically more
42   * appropriate choices.
43   *
44 < * <p>A ForkJoinPool may be constructed with a given parallelism level
45 < * (target pool size), which it attempts to maintain by dynamically
46 < * adding, suspending, or resuming threads, even if some tasks are
47 < * waiting to join others. However, no such adjustments are performed
48 < * in the face of blocked IO or other unmanaged synchronization. The
49 < * nested {@link ManagedBlocker} interface enables extension of
50 < * the kinds of synchronization accommodated.  The target parallelism
51 < * level may also be changed dynamically ({@link #setParallelism})
52 < * and thread construction can be limited using methods
53 < * {@link #setMaximumPoolSize} and/or
54 < * {@link #setMaintainsParallelism}.
44 > * <p>A {@code ForkJoinPool} may be constructed with a given
45 > * parallelism level (target pool size), which it attempts to maintain
46 > * by dynamically adding, suspending, or resuming threads, even if
47 > * some tasks are waiting to join others. However, no such adjustments
48 > * are performed in the face of blocked IO or other unmanaged
49 > * synchronization. The nested {@link ManagedBlocker} interface
50 > * enables extension of the kinds of synchronization accommodated.
51 > * The target parallelism level may also be changed dynamically
52 > * ({@link #setParallelism}) and thread construction can be limited
53 > * using methods {@link #setMaximumPoolSize} and/or {@link
54 > * #setMaintainsParallelism}.
55   *
56   * <p>In addition to execution and lifecycle control methods, this
57   * class provides status check methods (for example
# Line 62 | Line 63 | import java.util.concurrent.atomic.Atomi
63   * <p><b>Implementation notes</b>: This implementation restricts the
64   * maximum number of running threads to 32767. Attempts to create
65   * pools with greater than the maximum result in
66 < * IllegalArgumentExceptions.
66 > * {@code IllegalArgumentException}.
67   *
68   * @since 1.7
69   * @author Doug Lea

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines