You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Ramkumar Ramalingam (JIRA)" <tu...@ws.apache.org> on 2008/03/31 13:02:24 UTC
[jira] Created: (TUSCANY-2170) Synchronizing the access to
SCADefinitions
Synchronizing the access to SCADefinitions
------------------------------------------
Key: TUSCANY-2170
URL: https://issues.apache.org/jira/browse/TUSCANY-2170
Project: Tuscany
Issue Type: Bug
Components: Java SCA Core Runtime
Affects Versions: Java-SCA-Next
Environment: SVN revision 642920 - Windows
Reporter: Ramkumar Ramalingam
Priority: Minor
Fix For: Java-SCA-Next
http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg29138.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Updated: (TUSCANY-2170) Synchronizing the access to
SCADefinitions
Posted by "Ramkumar Ramalingam (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ramkumar Ramalingam updated TUSCANY-2170:
-----------------------------------------
Attachment: SCADefinitionsImpl-JIRA-2170.patch
> Synchronizing the access to SCADefinitions
> ------------------------------------------
>
> Key: TUSCANY-2170
> URL: https://issues.apache.org/jira/browse/TUSCANY-2170
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Environment: SVN revision 642920 - Windows
> Reporter: Ramkumar Ramalingam
> Priority: Minor
> Fix For: Java-SCA-Next
>
> Attachments: SCADefinitionsImpl-JIRA-2170.patch
>
>
> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg29138.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Assigned: (TUSCANY-2170) Synchronizing the access to
SCADefinitions
Posted by "Venkatakrishnan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Venkatakrishnan reassigned TUSCANY-2170:
----------------------------------------
Assignee: Venkatakrishnan
> Synchronizing the access to SCADefinitions
> ------------------------------------------
>
> Key: TUSCANY-2170
> URL: https://issues.apache.org/jira/browse/TUSCANY-2170
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Environment: SVN revision 642920 - Windows
> Reporter: Ramkumar Ramalingam
> Assignee: Venkatakrishnan
> Priority: Minor
> Fix For: Java-SCA-Next
>
> Attachments: SCADefinitionsImpl-JIRA-2170.patch
>
>
> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg29138.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Commented: (TUSCANY-2170) Synchronizing the access to
SCADefinitions
Posted by "Ramkumar Ramalingam (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584098#action_12584098 ]
Ramkumar Ramalingam commented on TUSCANY-2170:
----------------------------------------------
Learnt that using Vectors OR Collections.synchronizedList synchronizes your list object. However, the iterators implemented in the java.util Collections classes are fail-fast, which means that if one thread changes a collection while another thread is traversing it through an Iterator, the next Iterator.hasNext() or Iterator.next() call will throw ConcurrentModificationException. If we have to prevent ConcurrentModificationException, we must lock the entire List while you are iterating by wrapping it with a synchronized block, which inturn is costly.
As a solution to the above problem, the CopyOnWriteArrayList class from util.concurrent (which will also appear in the java.util.concurrent package in JDK 1.5) is a thread-safe implementation of ArrayList that offers far better concurrency. Multiple reads can almost always execute concurrently, simultaneous reads and writes can usually execute concurrently, and multiple simultaneous writes can often execute concurrently. Also CopyOnWriteArrayList contains a mutable reference to an immutable array, so as long as that reference is held fixed, you get all the thread-safety benefits of immutability without the need for locking.
Hence i believe the best solution would be to go with CopyOnWriteArrayList instead of the current ArrayList used to store the list of policy sets, intents, binding types etc.
Please suggest me if this one is the right approach. Thanks.
> Synchronizing the access to SCADefinitions
> ------------------------------------------
>
> Key: TUSCANY-2170
> URL: https://issues.apache.org/jira/browse/TUSCANY-2170
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Environment: SVN revision 642920 - Windows
> Reporter: Ramkumar Ramalingam
> Priority: Minor
> Fix For: Java-SCA-Next
>
>
> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg29138.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Commented: (TUSCANY-2170) Synchronizing the access to
SCADefinitions
Posted by "Ramkumar Ramalingam (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583638#action_12583638 ]
Ramkumar Ramalingam commented on TUSCANY-2170:
----------------------------------------------
The current implementation SCADefinitionsImpl.java uses java ArrayList to store the list of policy sets, intents, binding types etc. I believe Instead of synchronizing the methods that does the operations like clear/addAll. I believe the best solution would be to replace the ArrayList with a Vector.
Please suggest me if this one is the right approach. Thanks.
> Synchronizing the access to SCADefinitions
> ------------------------------------------
>
> Key: TUSCANY-2170
> URL: https://issues.apache.org/jira/browse/TUSCANY-2170
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Environment: SVN revision 642920 - Windows
> Reporter: Ramkumar Ramalingam
> Priority: Minor
> Fix For: Java-SCA-Next
>
>
> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg29138.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Resolved: (TUSCANY-2170) Synchronizing the access to
SCADefinitions
Posted by "Venkatakrishnan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Venkatakrishnan resolved TUSCANY-2170.
--------------------------------------
Resolution: Fixed
Patch applied in r646208. Thanks for the patch.
> Synchronizing the access to SCADefinitions
> ------------------------------------------
>
> Key: TUSCANY-2170
> URL: https://issues.apache.org/jira/browse/TUSCANY-2170
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Environment: SVN revision 642920 - Windows
> Reporter: Ramkumar Ramalingam
> Assignee: Venkatakrishnan
> Priority: Minor
> Fix For: Java-SCA-Next
>
> Attachments: SCADefinitionsImpl-JIRA-2170.patch
>
>
> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg29138.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org