Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358552 - Use FastList for listener lists and do not exclude duplicate listener elements
Summary: Use FastList for listener lists and do not exclude duplicate listener elements
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Lighter, Faster and Better
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 05:36 EDT by Eike Stepper CLA
Modified: 2012-09-21 07:16 EDT (History)
0 users

See Also:


Attachments
Patch v1 (4.73 KB, patch)
2011-09-22 06:03 EDT, Eike Stepper CLA
no flags Details | Diff
Patch v2 (15.41 KB, patch)
2011-09-22 10:44 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.