On Thu, Sep 17, 2009 at 1:25 PM, Mark Volkmann <r.mark.volkm...@gmail.com> wrote: > > On Thu, Sep 17, 2009 at 11:12 AM, John Harrop <jharrop...@gmail.com> wrote: >> >> Not with ref-set! or alter!, but maybe with commute identity? > > I should have been more clear above. What I meant was that multiple > concurrent transactions cannot write the same Ref without some of them > having to retry. If you use commute instead of ref-set or alter then > they don't have to retry.
But lets be careful here. (commute identity foo) does not help when you need (ensure foo), that is the latter can guard against write skew but the former cannot. The value returned by (commute identity foo) may not be the same value committed by the transaction, while the whole point of ensure is to make sure the value you used in the transaction is the same as when the transaction commits. --Chouser --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---