From: MenTaLguY Date: 2007-06-09T06:13:28+09:00 Subject: Re: Synchronized attr_accessor On Sat, 9 Jun 2007 04:55:24 +0900, Nasir Khan wrote: > This is about having a instance variable always accessed under a lock, > if object state (instance variables) are accessed by many threads at > the same time for eg. a hash accessed by several threads for getting values but some > operation also adding deleting from the hash. You would want a > synchronized access to your hash in this case... Just because access to an instance variable is synchronized does not mean that access to the object it references is synchronized. Retrieving a hash object via a synchronized accessor does not make it safe against concurrent modification. There are approaches which will work, but to know which ones to suggest, I will need to know more about the "bigger picture" that this code is part of. -mental