RFR: 8255070: Shenandoah: Use single thread for concurrent CLD liveness test [v2]

Roman Kennke rkennke at openjdk.java.net
Wed Oct 21 15:42:17 UTC 2020


On Wed, 21 Oct 2020 15:28:26 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> Since the concurrent liveness test does not touch any oops, there is no point to use multi-thread for the task, they just duplicate the work.
>> 
>> Also, multi-thread version requires to acquire ClassLoaderGraph_lock early, which is deadlock prone.
>
> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reduce duplicated code

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp line 108:

> 106:       f(clds);
> 107:       if (SINGLE_THREADED) ClassLoaderDataGraph_lock->unlock();
> 108:       _semaphore.claim_all();

Would it be nicer to write this as follows?
if (SINGLE_THREADED) {
  MutexLocker ml(ClassLoaderDataGraph_lock);
  f(clds);
} else {
  f(clds);
}

-------------

PR: https://git.openjdk.java.net/jdk/pull/777


More information about the shenandoah-dev mailing list