Ah, that makes more sense. Light just went on. Let me fiddle with this a bit longer.
Thanks very much. Tim Washington Interruptsoftware.ca No 6: "I'm not a number. I'M A FREE MAN!!!" No 2: "HA HA HA HA HAAAAAAA" -- The Prisoner On Mon, Apr 22, 2013 at 6:09 PM, Neale Swinnerton <[email protected]>wrote: > > On 22 Apr 2013 20:19, "Timothy Washington" <[email protected]> wrote: > > > > Before getting into the nitty gritty, is there something obvious I can > do to fix this code? Is alter a blocking call? > > You are seeing STM transaction restarts in action > > It looks like you are assuming that STM will serialise your transactions > like, say, RDBMS transactions, on a first come first served basis with > subsequent transactions blocked until the current one is complete? > > If this is your assumption, it's not correct I'm afraid. > > You must write the body of the dosync such that it can run multiple > times, each run starting with a different (but consistent) view of the ref > universe. > > Without more nitty gritty it's difficult to know more. Possibly a queue > is a better fit here? Have you considered using one from > java.util.concurrent ? > > -- > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
