get(), set(),
add() and increment() operations the logical contents of the array.
ConcurrentPackedLongArray supports concurrent accumulation, with the add()
and increment() methods providing lossless atomic accumulation in the presence of
multiple writers. However, it is impotant to note that add() and increment()
are the *only* safe concurrent operations, and that all other operations, including
get(), set() and clear() may produce "suprising" results if used on an
array that is not at rest.
While the add() and increment() methods are not quite wait-free, they
come "close" that behvaior in the sense that a given thread will incur a total of no more than a capped
fixed number (e.g. 74 in a current implementation) of non-wait-free add or increment operations during
the lifetime of an array, regradless of the number of operations done.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv transient WriterReaderPhaser |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Overrides org. |
| pack-priv void | |
| public ConcurrentPackedLongArray | copy()
Overrides org. |
| pack-priv long | |
| pack-priv void | criticalSectionExit(long criticalValueAtEnter)
Overrides org. |
| private void | |
| pack-priv void | resizeStorageArray(final int newPhysicalLengthInLongs)
Overrides org. |
| public void | setVirtualLength(final int
the newVirtualArrayLength)Overrides org. |
| public String | toString()
Overrides org. |
| wrp | back to summary |
|---|---|
| pack-priv transient WriterReaderPhaser wrp | |
| ConcurrentPackedLongArray | back to summary |
|---|---|
| public ConcurrentPackedLongArray(final int virtualLength) | |
| ConcurrentPackedLongArray | back to summary |
|---|---|
| public ConcurrentPackedLongArray(final int virtualLength, final int initialPhysicalLength) | |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Doc from org. Clear the array contents
| |
| clearContents | back to summary |
|---|---|
| pack-priv void clearContents() Overrides org.
| |
| copy | back to summary |
|---|---|
| public ConcurrentPackedLongArray copy() Overrides org. Doc from org. Create a copy of this array, complete with data and everything.
| |
| criticalSectionEnter | back to summary |
|---|---|
| pack-priv long criticalSectionEnter() Overrides org.
| |
| criticalSectionExit | back to summary |
|---|---|
| pack-priv void criticalSectionExit(long criticalValueAtEnter) Overrides org.
| |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream o) throws IOException, ClassNotFoundException | |
| resizeStorageArray | back to summary |
|---|---|
| pack-priv void resizeStorageArray(final int newPhysicalLengthInLongs) Overrides org.
| |
| setVirtualLength | back to summary |
|---|---|
| public void setVirtualLength(final int newVirtualArrayLength) Overrides org. Doc from org. Set a new virtual length for the array.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |