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

David Bosschaert updated FELIX-4544:
------------------------------------

    Attachment: FELIX_4544.patch

The patch FELIX_4544.patch is a first attempt at simplifying the locking. I 
made use of Java 5 concurrent collections, specifically ConcurrentMap, to 
reduce the need for synchonization. When multiple objects are concerned or when 
something cannot be done in a single atomic operation, I still use locking and 
at this stage I just use the URL.class object to lock on, which was widely used 
in the previous version already.
I guess this object was originally chosen to coordinate locking across multiple 
frameworks all running in the same VM. The URL.class is an object visible to 
all of them.

I'm sure there are things to be improved on the patch, this is just a first 
attempt. It's also using Java 5 so I guess it needs to be discussed first 
whether the Felix framework can move up to that or not...

> Simplify locking in URLHandlers
> -------------------------------
>
>                 Key: FELIX-4544
>                 URL: https://issues.apache.org/jira/browse/FELIX-4544
>             Project: Felix
>          Issue Type: Task
>          Components: Framework
>    Affects Versions: framework-4.4.0
>            Reporter: David Bosschaert
>            Priority: Minor
>         Attachments: FELIX_4544.patch
>
>
> The URLHandlers class has a lot of complicated synchronization which makes it 
> hard to predict its behaviour wrt to deadlocks. Currently this class 
> synchronizes on 5 objects: the URL.class object, the this object, 
> m_classloaderToFrameworkLists, m_frameworks and m_builtIn.
> While it might be that all these locks are needed, it would be nice to 
> investigate whether this class could be refactored to use less 
> synchronization so that there are less chances of deadlocks.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to