CMS parallel initial mark

Hiroshi Yamauchi yamauchi at
Thu Jun 13 19:00:05 UTC 2013

>  - I think CMSCollector::_eden_chunk_**sampling_active should be volatile
>>>> to avoid any clever compilers skipping the read in sample_eden_chunk().
>>>> (Although I don't think it's possible here). See also below for avoiding
>>>> that variable completely.
>>> Could you explain you thinking for making it volatile.  As you have, I
>>> didn't think
>>> it was necessary and thought ,"If not necessary, don't do it".
>> It's not necessary I think, just as a reminder to the compiler to not
>> optimize that load away. I think the Atomic instruction contain the
>> necessary instructions though.
> Ok.  I might be a bit of a distraction to include volatile when
> not necessary.

I haven't thought about this volatile thing too much. But it seems
unnecessary, even if we keep this _eden_chunk_**sampling_active, as opposed
to using try_lock() which I haven't thought about yet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the hotspot-gc-dev mailing list