Thanks a lot. Seems like i need to look deeper into the JVM and hardware intrinsics to understand some pecularities of core libs class designs.
Sent from my iPhone > On Dec 1, 2014, at 20:27, Vitaly Davidovich <vita...@gmail.com> wrote: > > 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