77 |
|
* continuations, other threads need not block waiting to perform |
78 |
|
* them. |
79 |
|
* |
80 |
< |
* <p> For example, here is an initial version of a class that uses |
80 |
> |
* <p>For example, here is an initial version of a class that uses |
81 |
|
* divide-by-two recursive decomposition to divide work into single |
82 |
|
* pieces (leaf tasks). Even when work is split into individual calls, |
83 |
|
* tree-based techniques are usually preferable to directly forking |
142 |
|
* |
143 |
|
* As a further improvement, notice that the left task need not even |
144 |
|
* exist. Instead of creating a new one, we can iterate using the |
145 |
< |
* original task, and add a pending count for each fork. |
145 |
> |
* original task, and add a pending count for each fork. |
146 |
|
* |
147 |
|
* <pre> {@code |
148 |
|
* class ForEach<E> ... |
477 |
|
throw new Error(e); |
478 |
|
} |
479 |
|
} |
480 |
+ |
|
481 |
|
/** |
482 |
|
* Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package. |
483 |
|
* Replace with a simple call to Unsafe.getUnsafe when integrating |
505 |
|
} |
506 |
|
} |
507 |
|
} |
507 |
– |
|
508 |
|
} |