On Jun 19, 2:44 pm, Rich Hickey <[email protected]> wrote:
> On Fri, Jun 19, 2009 at 9:35 AM, Eric Willigers<[email protected]> wrote:
>
> > On Jun 18, 9:35 pm, Rich Hickey <[email protected]> wrote:
> >>http://clojure.org/refs
>
> >> point #8:
>
> >> "If a constraint on the validity of a value of a Ref that is being
> >> changed depends upon the simultaneous value of a Ref that is not being
> >> changed, that second Ref can be protected from modification by calling
> >> ensure. Refs 'ensured' this way will be protected (item #3), but don't
> >> change the world (item #2)."
>
> >> That describes your situation, and you can use 'ensure' to ensure the
> >> serializability of your reads.
>
> > Thanks, that was all very helpful. With ensure, there's no write skew.
>
> >> This is better than the "dummy write"
> >> solution in that multiple ensures of the same refs don't conflict.
>
> > I haven't been able to verify this part - are you refering to
> > Clojure's current implementation? In my experiment below using Clojure
> > 1.0.0, I'm seeing conflicts.
>
> They don't conflict, but you are correct that Clojure's STM currently
> doesn't leverage that fact. It is my intention that at some point it
> will, so please use ensure rather than dummy writes.
>
I've implemented overlapping ensure in the ensure branch:
http://github.com/richhickey/clojure/tree/ensure
Everyone using the STM please try it out.
Thanks,
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---