Packing 2 data points into 1 field in ThreadPoolExecutor
vitalyd at gmail.com
Mon Dec 1 17:27:16 UTC 2014
It allows to manipulate two (related) bits of info atomically without
needing a lock and when efficient double CAS is not available (which it
isn't on supported archs).
Sent from my phone
On Dec 1, 2014 12:23 PM, "Alex Yursha" <alexyursha at gmail.com> wrote:
> Hi all,
> According to javadoc current implementation of ThreadPoolExecutor packs
> two conceptual fields ‘workerCount’ and ‘runState’ into one actual field
> ‘ctl’ of type AtomicInteger.
> Could you please explain are there any performance or other benefits for
> this? It seems to complicate the class design and I can’t find the positive
> side of this.
More information about the core-libs-dev