[concurrency-interest] Question about re-ordering

Vitaly Davidovich vitalyd at gmail.com
Tue Jan 17 18:25:31 EST 2012


Yes clear() runs before put() in same thread - reordering would utterly
break semantics, this is unrelated to concurrency.

Sent from my phone
On Jan 17, 2012 6:13 PM, "Nader Aeinehchi" <nader at aeinehchi.com> wrote:

> Hi
>
> In the following, a listener is notified by some configurator.  Question
> is whether a re-ordering may be enforced by compiler on the operations on
> "stateMap"?  Is it safe to assume that stateMap.clear() is always run
> before stateMap.put within the same thread?
>
>    public void notify(ConfigurationEvent event) {
>        if (event.getType() == AbstractFileConfiguration.**EVENT_RELOAD) {
>            logger.warn("log something");
>
>            stateMap.clear();
>
>            List<SubnodeConfiguration> configurations = xmlConfiguration.**
> configurationsAt("*");
>            for (SubnodeConfiguration subnodeConfiguration :
> configurations) {
>                stateMap.put(**subnodeConfiguration.**getString("@configurationId"),
> new State(subnodeConfiguration));
>            }
>        }
>    }
>
> Thanks
> ______________________________**_________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.**oswego.edu <Concurrency-interest at cs.oswego.edu>
> http://cs.oswego.edu/mailman/**listinfo/concurrency-interest<http://cs.oswego.edu/mailman/listinfo/concurrency-interest>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120117/9fb49cf3/attachment.html>


More information about the Concurrency-interest mailing list