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" <alexyur...@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. > > Thanks, > Alex > >