From: Nasir Khan Date: 2007-06-09T04:55:24+09:00 Subject: Re: Synchronized attr_accessor 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... So this could save some repetitive lines of code, that is all. - nasir On Jun 8, 12:48 pm, MenTaLguY wrote: > On Sat, 9 Jun 2007 04:34:42 +0900, Nasir Khan wrote: > > This works but obviously has some flaws, like for example first time > > creation of attribute is unprotected as is the nil check, also it does > > not address scope [private, protected etc.]. > > Could you describe are you trying to accomplish using these attributes? There is usually a better way to communicate between threads than setting/getting attributes on an object. > > -mental