83 |
|
* subdivided) to each element of an array or collection; especially |
84 |
|
* when the operation takes a significantly different amount of time |
85 |
|
* to complete for some elements than others, either because of |
86 |
< |
* intrinsic variation (for example IO) or auxiliary effects such as |
86 |
> |
* intrinsic variation (for example I/O) or auxiliary effects such as |
87 |
|
* garbage collection. Because CountedCompleters provide their own |
88 |
|
* continuations, other threads need not block waiting to perform |
89 |
|
* them. |
224 |
|
* public static <E> E search(E[] array) { |
225 |
|
* return new Searcher<E>(null, array, new AtomicReference<E>(), 0, array.length).invoke(); |
226 |
|
* } |
227 |
< |
*}}</pre> |
227 |
> |
* }}</pre> |
228 |
|
* |
229 |
|
* In this example, as well as others in which tasks have no other |
230 |
|
* effects except to compareAndSet a common result, the trailing |