jdk.internal.module.Service.ServicesCatalog should use synchronized to improve the VM boot time

forax at univ-mlv.fr forax at univ-mlv.fr
Thu Mar 17 12:25:04 UTC 2016



----- Mail original -----
> De: "Alan Bateman" <Alan.Bateman at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>, "jigsaw-dev" <jigsaw-dev at openjdk.java.net>
> Envoyé: Jeudi 17 Mars 2016 11:47:21
> Objet: Re: jdk.internal.module.Service.ServicesCatalog should use synchronized to improve the VM boot time
> 
> On 17/03/2016 10:37, Remi Forax wrote:
> > Hi all,
> > currently ServicesCatalog uses a R/W lock which is great if looking up for
> > a service was a contended operation,
> > but i don't think it is. I will not care if ServicesCatalog was not used
> > early in the boot process, but it is.
> >
> > As far as i know, no other class uses a R/W lock during the boot process
> > (I may be wrong, i've checked only against the latest jdk8)
> > so i think that
> > - using synchronized here is good enough
> > - it will avoid to load a bunch of classes from java.util.concurrent.locks
> > thus make the VM boot faster.
> >
> Fair point, it is the first user of ReentrantReadWriteLock. I expect
> we'll replace this code once we address a number of other issues and so
> I'd prefer not to change it now, at least for the initial integration.

yes, i agree, it's a post-integration works.


> 
> -Alan.
> 

Rémi


More information about the jigsaw-dev mailing list