You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Karl Pauls (JIRA)" <ji...@apache.org> on 2017/10/05 07:55:00 UTC

[jira] [Resolved] (SLING-7175) Improve concurrency in FSDynamicClassLoader

     [ https://issues.apache.org/jira/browse/SLING-7175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls resolved SLING-7175.
-------------------------------
    Resolution: Fixed

I applied the patch in r1811166.

> Improve concurrency in FSDynamicClassLoader
> -------------------------------------------
>
>                 Key: SLING-7175
>                 URL: https://issues.apache.org/jira/browse/SLING-7175
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>    Affects Versions: File System ClassLoader 1.0.6
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>             Fix For: File System ClassLoader 1.0.8
>
>         Attachments: SLING-7175.patch
>
>
> FSDynamicClassLoader currently maintains two synchronized sets of class names that have been loaded ( a "hit" and a "miss" set). That can be a source of contention when a lot of classes are loaded concurrently. 
> I think we can optimize this somewhat by a) merging the two sets into one (as they are never used independently from what I can tell) and b) using a Collections.newSetFromMap(new ConcurrentHashMap) instead of a Collections.synchronizedSet(new HashSet()). 
> Furthermore, the isDirty boolean flag should be volatile as it might be accessed concurrently. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)