You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (JIRA)" <ji...@apache.org> on 2016/05/06 15:31:13 UTC

[jira] [Comment Edited] (JEXL-194) synchronize on iterableValue in foreach statement

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

Henri Biestro edited comment on JEXL-194 at 5/6/16 3:31 PM:
------------------------------------------------------------

There is no requirement to synchronize simple Collections if they are  used only for iteration/access (i.e. readonly and/or unmodifiable) and it is not JEXL's role to solve concurrent iteration/write access to user structures. Besides, protecting iteration but not modification or access (array|property*Get|Set) leaves the concurrency hole wide open in most cases.
I'll try and seek an alternative route that could allow an easy specialization of iteration through operators, something like a forEach method that would return a (Closable) Iterator.


was (Author: henrib):
There is no requirement to synchronize simple Collections if they are  used only for iteration/access (i.e. readonly and/or unmodifiable) and it is not JEXL's role to solve concurrent iteration/write access to user structures. Besides, protecting iteration but not modification or access (array{S,G}et/property{S,G}et) leaves the concurrency hole wide open in most cases.
I'll try and seek an alternative route that could allow an easy specialization of iteration through operators, something like a forEach method that would return a (Closable) Iterator.

> synchronize on iterableValue in foreach statement
> -------------------------------------------------
>
>                 Key: JEXL-194
>                 URL: https://issues.apache.org/jira/browse/JEXL-194
>             Project: Commons JEXL
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Minor
>
> Since it is a requirement to synchronize on simple Collections and synchronized Collections while iterating over them and since jexl has no instrument to control synchronization in script, I think its reasonable to implement synchronization in jexl itself on iterableValue. In case of concurrent collections it will possibly block other threads only if they are synchronizing on those collections themselves, which will be complementary to required synchronization in jexl.



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