Nasir Khan
6/9/2007 5:37:00 AM
Actually facets/more/synchash.rb does what I was looking for hash.
Thanks
On 6/8/07, Nasir Khan <rubylearner@gmail.com> wrote:
> Yeah I see what you guys mean...I was a little delusional. Now I
> realize that I was looking for basically something equivalent to
> Java's -
> Collections.synchronizedMap(new HashMap(...))
> ...
> Thanks
>
>
>
>
> On 6/8/07, MenTaLguY <mental@rydia.net> wrote:
> > On Sat, 9 Jun 2007 06:54:04 +0900, Nasir Khan <rubylearner@gmail.com> wrote:
> > > There is no big picture.
> >
> > Since you had asked for feedback on anything you'd missed, I was trying to find out if was some mitigating factor in the specific way your program worked (the one for which you originally wrote this code), before telling you that it won't work.
> >
> > But -- unless the objects the attributes were set to were never modified, even if they didn't have the thread safety problems you already noted, the accessors generated still couldn't ensure thread safety. If thread 1 calls obj.some_accessor.foo, and thread 2 calls obj.some_accessor.bar (where #bar is some mutating method), some_accessor being synchronized simply _will not_ protect you.
> >
> > -mental
> >
> >
> >
>