96 |
|
* by this class. |
97 |
|
* |
98 |
|
* <p>ForkJoinTasks should perform relatively small amounts of |
99 |
< |
* computations, othewise splitting into smaller tasks. As a very |
99 |
> |
* computations, otherwise splitting into smaller tasks. As a very |
100 |
|
* rough rule of thumb, a task should perform more than 100 and less |
101 |
|
* than 10000 basic computational steps. If tasks are too big, then |
102 |
< |
* parellelism cannot improve throughput. If too small, then memory |
102 |
> |
* parallelism cannot improve throughput. If too small, then memory |
103 |
|
* and internal task maintenance overhead may overwhelm processing. |
104 |
|
* |
105 |
|
* <p>ForkJoinTasks are {@code Serializable}, which enables them |
128 |
|
* currently unused. Also value 0x80000000 is available as spare |
129 |
|
* completion value. |
130 |
|
*/ |
131 |
< |
volatile int status; // accessed directy by pool and workers |
131 |
> |
volatile int status; // accessed directly by pool and workers |
132 |
|
|
133 |
|
static final int COMPLETION_MASK = 0xe0000000; |
134 |
|
static final int NORMAL = 0xe0000000; // == mask |
575 |
|
* {@code isDone} holds for all of them. If any task |
576 |
|
* encounters an exception, others may be cancelled. This method |
577 |
|
* may be invoked only from within ForkJoinTask |
578 |
< |
* computations. Attempts to invoke in other contexts resul!t in |
578 |
> |
* computations. Attempts to invoke in other contexts result in |
579 |
|
* exceptions or errors possibly including ClassCastException. |
580 |
|
* @param tasks the collection of tasks |
581 |
|
* @throws NullPointerException if tasks or any element are null. |
639 |
|
|
640 |
|
/** |
641 |
|
* Asserts that the results of this task's computation will not be |
642 |
< |
* used. If a cancellation occurs before atempting to execute this |
642 |
> |
* used. If a cancellation occurs before attempting to execute this |
643 |
|
* task, then execution will be suppressed, {@code isCancelled} |
644 |
|
* will report true, and {@code join} will result in a |
645 |
|
* {@code CancellationException} being thrown. Otherwise, when |
753 |
|
* Possibly executes other tasks until this task is ready, then |
754 |
|
* returns the result of the computation. This method may be more |
755 |
|
* efficient than {@code join}, but is only applicable when |
756 |
< |
* there are no potemtial dependencies between continuation of the |
756 |
> |
* there are no potential dependencies between continuation of the |
757 |
|
* current task and that of any other task that might be executed |
758 |
|
* while helping. (This usually holds for pure divide-and-conquer |
759 |
|
* tasks). This method may be invoked only from within |
760 |
|
* ForkJoinTask computations. Attempts to invoke in other contexts |
761 |
< |
* resul!t in exceptions or errors possibly including ClassCastException. |
761 |
> |
* result in exceptions or errors possibly including ClassCastException. |
762 |
|
* @return the computed result |
763 |
|
*/ |
764 |
|
public final V helpJoin() { |
771 |
|
/** |
772 |
|
* Possibly executes other tasks until this task is ready. This |
773 |
|
* method may be invoked only from within ForkJoinTask |
774 |
< |
* computations. Attempts to invoke in other contexts resul!t in |
774 |
> |
* computations. Attempts to invoke in other contexts result in |
775 |
|
* exceptions or errors possibly including ClassCastException. |
776 |
|
*/ |
777 |
|
public final void quietlyHelpJoin() { |
961 |
|
* queued by the current thread but not yet executed, if one is |
962 |
|
* available, or if not available, a task that was forked by some |
963 |
|
* other thread, if available. Availability may be transient, so a |
964 |
< |
* {@code null} result does not necessarily imply quiecence |
964 |
> |
* {@code null} result does not necessarily imply quiescence |
965 |
|
* of the pool this task is operating in. This method is designed |
966 |
|
* primarily to support extensions, and is unlikely to be useful |
967 |
|
* otherwise. This method may be invoked only from within |