WriteBarriers and Weaklings...maybe Glorp?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WriteBarriers and Weaklings...maybe Glorp?

cdavidshaffer
I use the WriteBarriers package in my VW port of the GOODS client.  My
"trackers" (Tracker subclass instances) are held by barrier objects that
are, themselves held in my database sessions and weakly elsewhere so
that they can be cleaned up.  During mourning of these weak barriers I
release my trackers.  I'm getting an intermittent walkback during
Tracker class>>modified:selector:index:value:.  The problem is likely
caused by looping (inject:into:) during modification (during mourning)
of the Trackers collection referenced in said method.  Seems like a
pretty common situation.  The obvious solution is to add a mutator for
the Trackers shared variable so that my application can use a
thread-safe collection instead of an OrderedCollection.

I'm guessing Glorp hits this same problem if it uses WriteBarriers
(although I can't find a version of Glorp that does use WriteBarriers,
the blessing comment of WriteBarriers hints that such a thing exists).
I'm just wondering if there is some wisdom to be shared here...maybe
there's already a solution?

David

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: WriteBarriers and Weaklings...maybe Glorp?

Michael Lucas-Smith-2

On Nov 8, 2010, at 11:34 AM, C. David Shaffer wrote:

> I use the WriteBarriers package in my VW port of the GOODS client.  My
> "trackers" (Tracker subclass instances) are held by barrier objects that
> are, themselves held in my database sessions and weakly elsewhere so
> that they can be cleaned up.  During mourning of these weak barriers I
> release my trackers.  I'm getting an intermittent walkback during
> Tracker class>>modified:selector:index:value:.  The problem is likely
> caused by looping (inject:into:) during modification (during mourning)
> of the Trackers collection referenced in said method.  Seems like a
> pretty common situation.  The obvious solution is to add a mutator for
> the Trackers shared variable so that my application can use a
> thread-safe collection instead of an OrderedCollection.
>
> I'm guessing Glorp hits this same problem if it uses WriteBarriers
> (although I can't find a version of Glorp that does use WriteBarriers,
> the blessing comment of WriteBarriers hints that such a thing exists).
> I'm just wondering if there is some wisdom to be shared here...maybe
> there's already a solution?

GlorpActiveRecord uses the WriteBarriers. We also use them in Seaside-Glorp. I've never seen the problem you describe though. But I'll keep an eye out for it.

Michael


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc