45 |
|
* |
46 |
|
* <dt>Core and maximum pool sizes</dt> |
47 |
|
* |
48 |
< |
* <dd>A {@code ThreadPoolExecutor} will automatically adjust the |
48 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
49 |
> |
* A {@code ThreadPoolExecutor} will automatically adjust the |
50 |
|
* pool size (see {@link #getPoolSize}) |
51 |
|
* according to the bounds set by |
52 |
|
* corePoolSize (see {@link #getCorePoolSize}) and |
68 |
|
* |
69 |
|
* <dt>On-demand construction</dt> |
70 |
|
* |
71 |
< |
* <dd>By default, even core threads are initially created and |
71 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
72 |
> |
* By default, even core threads are initially created and |
73 |
|
* started only when new tasks arrive, but this can be overridden |
74 |
|
* dynamically using method {@link #prestartCoreThread} or {@link |
75 |
|
* #prestartAllCoreThreads}. You probably want to prestart threads if |
77 |
|
* |
78 |
|
* <dt>Creating new threads</dt> |
79 |
|
* |
80 |
< |
* <dd>New threads are created using a {@link ThreadFactory}. If not |
80 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
81 |
> |
* New threads are created using a {@link ThreadFactory}. If not |
82 |
|
* otherwise specified, a {@link Executors#defaultThreadFactory} is |
83 |
|
* used, that creates threads to all be in the same {@link |
84 |
|
* ThreadGroup} and with the same {@code NORM_PRIORITY} priority and |
95 |
|
* |
96 |
|
* <dt>Keep-alive times</dt> |
97 |
|
* |
98 |
< |
* <dd>If the pool currently has more than corePoolSize threads, |
98 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
99 |
> |
* If the pool currently has more than corePoolSize threads, |
100 |
|
* excess threads will be terminated if they have been idle for more |
101 |
|
* than the keepAliveTime (see {@link #getKeepAliveTime(TimeUnit)}). |
102 |
|
* This provides a means of reducing resource consumption when the |
113 |
|
* |
114 |
|
* <dt>Queuing</dt> |
115 |
|
* |
116 |
< |
* <dd>Any {@link BlockingQueue} may be used to transfer and hold |
116 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
117 |
> |
* Any {@link BlockingQueue} may be used to transfer and hold |
118 |
|
* submitted tasks. The use of this queue interacts with pool sizing: |
119 |
|
* |
120 |
|
* <ul> |
179 |
|
* |
180 |
|
* <dt>Rejected tasks</dt> |
181 |
|
* |
182 |
< |
* <dd>New tasks submitted in method {@link #execute(Runnable)} will be |
182 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
183 |
> |
* New tasks submitted in method {@link #execute(Runnable)} will be |
184 |
|
* <em>rejected</em> when the Executor has been shut down, and also when |
185 |
|
* the Executor uses finite bounds for both maximum threads and work queue |
186 |
|
* capacity, and is saturated. In either case, the {@code execute} method |
217 |
|
* |
218 |
|
* <dt>Hook methods</dt> |
219 |
|
* |
220 |
< |
* <dd>This class provides {@code protected} overridable |
220 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
221 |
> |
* This class provides {@code protected} overridable |
222 |
|
* {@link #beforeExecute(Thread, Runnable)} and |
223 |
|
* {@link #afterExecute(Runnable, Throwable)} methods that are called |
224 |
|
* before and after execution of each task. These can be used to |
234 |
|
* |
235 |
|
* <dt>Queue maintenance</dt> |
236 |
|
* |
237 |
< |
* <dd>Method {@link #getQueue()} allows access to the work queue |
237 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
238 |
> |
* Method {@link #getQueue()} allows access to the work queue |
239 |
|
* for purposes of monitoring and debugging. Use of this method for |
240 |
|
* any other purpose is strongly discouraged. Two supplied methods, |
241 |
|
* {@link #remove(Runnable)} and {@link #purge} are available to |
244 |
|
* |
245 |
|
* <dt>Finalization</dt> |
246 |
|
* |
247 |
< |
* <dd>A pool that is no longer referenced in a program <em>AND</em> |
247 |
> |
* <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif"> |
248 |
> |
* A pool that is no longer referenced in a program <em>AND</em> |
249 |
|
* has no remaining threads will be {@code shutdown} automatically. If |
250 |
|
* you would like to ensure that unreferenced pools are reclaimed even |
251 |
|
* if users forget to call {@link #shutdown}, then you must arrange |