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

Alan Bateman Alan.Bateman at oracle.com
Thu Mar 17 10:47:21 UTC 2016


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.

-Alan.


More information about the jigsaw-dev mailing list