From: Robert Klemme Date: 2012-06-11T16:52:47+09:00 Subject: Re: Is "a,b=c,d" atomic? or do I need a Mutex? On Sun, Jun 10, 2012 at 7:52 PM, Iñaki Baz Castillo wrote: > 2012/6/10 Bartosz Dziewoński : >> It is atomic on MRI. It may or may not be on other interpreters, if >> you care about them. (But probably should be as an element of the >> syntax.) >> >> Array#<< may or may not be atomic as well. (It is on MRI.) > > Thanks, so I've no problem since I'm coding for MRI. Sorry, but I think this is the wrong attitude. Even MRI's implementation can change and the default should be to properly synchronize access to shared resources - if only for documenting the shared access. Note also that multiple threads may invoke #method2 which makes synchronization necessary even in absence of swapping. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/