41 |
|
|
42 |
|
/** |
43 |
|
* Creates a thread pool that reuses a fixed set of threads |
44 |
< |
* operating off a shared unbounded queue. If any thread |
45 |
< |
* terminates due to a failure during execution prior to shutdown, |
46 |
< |
* a new one will take its place if needed to execute subsequent |
47 |
< |
* tasks. |
44 |
> |
* operating off a shared unbounded queue. At any point, at most |
45 |
> |
* <tt>nThreads</tt> threads will be active processing tasks. If |
46 |
> |
* additional tasks are submitted when all threads are active, |
47 |
> |
* they will wait in the queue until a thread is available. If |
48 |
> |
* any thread terminates due to a failure during execution prior |
49 |
> |
* to shutdown, a new one will take its place if needed to execute |
50 |
> |
* subsequent tasks. |
51 |
|
* |
52 |
|
* @param nThreads the number of threads in the pool |
53 |
|
* @return the newly created thread pool |
61 |
|
/** |
62 |
|
* Creates a thread pool that reuses a fixed set of threads |
63 |
|
* operating off a shared unbounded queue, using the provided |
64 |
< |
* ThreadFactory to create new threads when needed. |
64 |
> |
* ThreadFactory to create new threads when needed. At any point, |
65 |
> |
* at most <tt>nThreads</tt> threads will be active processing |
66 |
> |
* tasks. If additional tasks are submitted when all threads are |
67 |
> |
* active, they will wait in the queue until a thread is |
68 |
> |
* available. If any thread terminates due to a failure during |
69 |
> |
* execution prior to shutdown, a new one will take its place if |
70 |
> |
* needed to execute subsequent tasks. |
71 |
|
* |
72 |
|
* @param nThreads the number of threads in the pool |
73 |
|
* @param threadFactory the factory to use when creating new threads |
104 |
|
* Creates an Executor that uses a single worker thread operating |
105 |
|
* off an unbounded queue, and uses the provided ThreadFactory to |
106 |
|
* create a new thread when needed. Unlike the otherwise |
107 |
< |
* equivalent <tt>newFixedThreadPool(1, threadFactory)</tt> the returned executor |
108 |
< |
* is guaranteed not to be reconfigurable to use additional |
109 |
< |
* threads. |
107 |
> |
* equivalent <tt>newFixedThreadPool(1, threadFactory)</tt> the |
108 |
> |
* returned executor is guaranteed not to be reconfigurable to use |
109 |
> |
* additional threads. |
110 |
|
* |
111 |
|
* @param threadFactory the factory to use when creating new |
112 |
|
* threads |