-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
7
-
None
-
generic
-
generic
Serialized Form javadoc for java.util.concurrent.ForkJoinTask says:
--- cut ---
Serialized Fields
...
int status
Run control status bits packed into a single int to minimize footprint and
to ensure atomicity (via CAS). Status is initially zero, and takes on
nonnegative values until completed, upon which status holds COMPLETED.
CANCELLED, or EXCEPTIONAL, which use the top 3 bits. Tasks undergoing
blocking waits by other threads have SIGNAL_MASK bits set -- bit 15 for
external (nonFJ) waits, and the rest a count of waiting FJ threads. (This
representation relies on ForkJoinPool max thread limits). Completion of a
stolen task with SIGNAL_MASK bits set awakens waiter via notifyAll. Even
though suboptimal for some purposes, we use basic builtin wait/notify to
take advantage of "monitor inflation" in JVMs that we would otherwise need
to emulate to avoid adding further per-task bookkeeping overhead. Note
that bits 16-28 are currently unused. Also value 0x80000000 is available
as spare completion value.
--- cut ---
There are two issues here:
- the constants CANCELLED, EXCEPTIONAL and SIGNAL_MASK have package-private
access so their exact values are not available at javadoc;
- the ForkJoinTask class does not contain a constant with name COMPLETED.
--- cut ---
Serialized Fields
...
int status
Run control status bits packed into a single int to minimize footprint and
to ensure atomicity (via CAS). Status is initially zero, and takes on
nonnegative values until completed, upon which status holds COMPLETED.
CANCELLED, or EXCEPTIONAL, which use the top 3 bits. Tasks undergoing
blocking waits by other threads have SIGNAL_MASK bits set -- bit 15 for
external (nonFJ) waits, and the rest a count of waiting FJ threads. (This
representation relies on ForkJoinPool max thread limits). Completion of a
stolen task with SIGNAL_MASK bits set awakens waiter via notifyAll. Even
though suboptimal for some purposes, we use basic builtin wait/notify to
take advantage of "monitor inflation" in JVMs that we would otherwise need
to emulate to avoid adding further per-task bookkeeping overhead. Note
that bits 16-28 are currently unused. Also value 0x80000000 is available
as spare completion value.
--- cut ---
There are two issues here:
- the constants CANCELLED, EXCEPTIONAL and SIGNAL_MASK have package-private
access so their exact values are not available at javadoc;
- the ForkJoinTask class does not contain a constant with name COMPLETED.
- duplicates
-
JDK-6978087 jsr166y Updates
-
- Closed
-