Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358552

Summary: Use FastList for listener lists and do not exclude duplicate listener elements
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3    
Version: 4.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: Lighter, Faster and Better
Attachments:
Description Flags
Patch v1
none
Patch v2 none

Description Eike Stepper CLA 2011-09-22 05:36:11 EDT
FastList supports thread safe read access without copying or synchronizing.
Comment 1 Eike Stepper CLA 2011-09-22 06:03:14 EDT
Created attachment 203830 [details]
Patch v1
Comment 2 Eike Stepper CLA 2011-09-22 10:44:26 EDT
I'm going to rename FastList to Concurrent Array to better reflect its purpose. In addition I'll add a Unique subclass that ignores duplicate additions. It turned out that  the three handler/filter lists in AbstractPlatform need to be unique because that class is a singleton and duplicate registrations are likely to occur. E.g. in the test suites thousands of trace handlers get registered, slowing down pace tremendously :P
Comment 3 Eike Stepper CLA 2011-09-22 10:44:54 EDT
Created attachment 203845 [details]
Patch v2
Comment 4 Eike Stepper CLA 2011-09-22 10:45:24 EDT
Committed revision 9202:
- trunk/plugins/org.eclipse.emf.cdo
- trunk/plugins/org.eclipse.emf.cdo.common
- trunk/plugins/org.eclipse.net4j.tests
- trunk/plugins/org.eclipse.net4j.util
Comment 5 Eike Stepper CLA 2011-09-22 10:48:32 EDT
Resolved
Comment 6 Eike Stepper CLA 2011-09-29 03:46:08 EDT
Code like if(handlers!=null) is now meaningless.

In CDOTransactionImpl.CDOCommitContextImpl.preCommit() the following must be used:

	if (handlers.length != 0) // !!!
Comment 7 Eike Stepper CLA 2011-09-29 03:48:32 EDT
Committed revision 9421:
- trunk/plugins/org.eclipse.emf.cdo
- trunk/plugins/org.eclipse.net4j.util
Comment 8 Eike Stepper CLA 2011-10-11 05:10:25 EDT
Committed revision 9473:
- trunk/plugins/org.eclipse.net4j.tests
Comment 9 Eike Stepper CLA 2012-09-21 07:16:45 EDT
Closing.