CMS parallel initial mark

Jon Masamitsu jon.masamitsu at oracle.com
Fri Jun 7 18:28:09 UTC 2013


On 6/7/2013 4:23 AM, Thomas Schatzl wrote:
>
>
>
>
>
> - the code to get the lock on _eden_chunk_sampling_active seems to be
> needlessly complicated.
>
> Please consider using a dedicated Monitor in conjunction with
> try_lock(). I.e.
Thomas,

Any concerns about the "sneak" code in try_lock()?  That would only
matter if the VM thread were involved in the eden sampling along with
other GC threads, yes?

Jon

>
> in CMSCollector add a
>
> Monitor * _cms_eden_sampling_lock; // initialize in the constructor
>
> and then
>
> if (_cms_eden_sampling_lock->try_lock()) {
>
>    // do sampling
>
>    _cms_eden_sampling_lock->unlock();
> }
>
> Monitor::try_lock() boils down to the exactly same code, uses a CAS to
> obtain the lock. I cannot see a reason to roll an own lock
> implementation here.
>
> Hiroshi, is it possible for you to take another look at this change? It
> would help us a lot. If there are questions, please do not hesitate to
> ask.
>
> Thanks a lot for your contributions so far,
> Thomas
>




More information about the hotspot-gc-dev mailing list