[ 
https://issues.apache.org/jira/browse/FELIX-4866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14546956#comment-14546956
 ] 

Pierre De Rop commented on FELIX-4866:
--------------------------------------

Ok, I added a new simpler test which is easier to understand, and much more 
compact.
Can you please take a look now at the new 
org.apache.felix.framework.concurrencytest sub bundle in the sandbox [1].

So, in the concurrencytest bundle, we have now a simple testcase which 
registers concurrently some Components that have dependencies with each other 
(using basic ServiceTrackers). When the nth component is created (from the 
threadpool), a ServiceTracker is created in order to depend on the nth+1 
component. There are 10 Components. the first one depends on the second one, 
the second one on the third, etc ...

All component service trackers and service registrations are performed in a 
fork joind pool. And when the fork join pool becomes quiescent (when all 
components and service trackers are all registered and opened), then we inspect 
each component and check if each nth component has been injected with the nth+1 
component.

With Felix fwk 5.0.0 and with Equinox 3.10.1, the test completes, but it fails 
with the felix framework from the trunk (you can switch the framework by 
changing the -runfw option in the 
org.apache.felix.framework.concurrencytest/bnd.bnd file).

So, I may be wrong but it looks like there is a concurrency issue in the 
framework when a component is registered and when a service tracker that tracks 
the registering component is opened at the same time in another thread.


[1] 
http://svn.apache.org/viewvc/felix/sandbox/pderop/bndtools-FELIX-4866/org.apache.felix.framework.concurrencytest/

> Improve service registry
> ------------------------
>
>                 Key: FELIX-4866
>                 URL: https://issues.apache.org/jira/browse/FELIX-4866
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-5.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: David Bosschaert
>             Fix For: framework-5.2.0
>
>
> The current service registry is currently not using any of the Java 5 
> concurrent data structures. Using those could improve the implementation, the 
> readibility of the code and potentially the performance of the service 
> registry.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to