From: Robert Dober Date: 2007-06-09T07:23:43+09:00 Subject: Re: Synchronized attr_accessor On 6/8/07, Nasir Khan wrote: > There is no big picture. > The problem is simple - "create accessors for an instance variable > that access the variable under a lock". > Just as problem statement for "attr_accessor" could be - "create > accessors for instance variables" Hmm there is no such thing as a lock on an ivar. By declaring a synchronized accessor there is just no way to know anything about the behavior of the accessed object, it might be threadsafe or immutable, therefore it does not make much sense to me and if I have understood your code correctly neither to Ruby. Imagine someone using your synchronized accessor to change the ivar to a simple integer, your code would fail at the next access attempt. Cheers Robert