RFR: 8060130: Simplify the synchronization of defining and getting java.lang.Package
peter.levart at gmail.com
Sun Oct 12 11:02:44 UTC 2014
On 10/12/2014 12:52 PM, Peter Levart wrote:
> On 10/12/2014 12:40 PM, Peter Levart wrote:
>> I also wonder if the lazy loading of Manifest in CachedManifest is
>> necessary. If you look at the only usage of
>> CachedManifest.getManifest() method (in Package.defineSystemPackage()):
>> CachedManifest cachedManifest = createCachedManifest(fn);
>> pkgs.putIfAbsent(name, new Package(name,
>> ...you can see that getManifest() is called immediately after
>> obtaining the CacheManifest. So there's no need for lazy loading.
>> Loading the Manifest in CachedManifest constructor would be just fine.
> ..Ah, you can do that, yes, but then you have to use synchronization
> in createCachedManifest in order to avoid redundant concurrent loading
> of Manifest. And that would be a good thing since then you avoid
> concurrent resolving of fileName -> URL too in one go.
Scrap that. I see now what you wanted to achieve. You wanted to avoid
synchronization on a single monitor when loading manifests while
avoiding multiple concurrent loading of same manifest. Lazy loading is
More information about the core-libs-dev