From: "Vishnu I." Date: 2011-01-06T19:49:34+09:00 Subject: Re: Threading in ruby > Yes. But there is no additional synchronization needed for access to > the Array or Hash instances in the array. It is sufficient to only > update the index in a synchronized block. And in fact that is the > only operation that you should do there (apart from the condition > variable signal). > > The term "memory barrier" is a concept from the JVM. AFAIK in Ruby's > MRI there is no concept as thread local and global memory (which the > memory barriers update). Second, a memory barrier effects *all the > memory*. Whatever changes were done before it are then propagated to > between memories (in JVM of course). > > Does that help? > > Kind regards > > robert oops Im sorry I wasnt clear. My question was why would I need to synchronize on the read of the index variable if the synchronized write has created a memory barrier between the updation of the list item and the index update? Thats the only piece i couldnt follow -- Posted via http://www.ruby-forum.com/.