Thanks guys. I have been able to get the ref-history-count greater than 0 by increasing ref-min-history to something greater than 0 and by using long (using Thread/sleep) running transactions.
Now i get it Josh On Thu, May 30, 2013 at 6:01 PM, Neale Swinnerton <ne...@isismanor.com>wrote: > > On Thu, May 30, 2013 at 3:05 PM, Josh Kamau <joshnet2...@gmail.com> wrote: >> >> I am trying to understand (ref-history-count ref) . I thought it counts >> the number of "old" values in the ref. But in all my tests, its always >> returning zero. How is it used? >> > > In clojure's STM, history is created only when required. This is a > performance choice, the assumption is that 'most' STM transactions won't > contend. In your case you have only one transaction so no history is ever > created. > > Try creating a long running transaction in one thread and executing short > running transactions in other thread(s) all altering the same ref and you > will see history in action. > > HTH. > > -- > -- > 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 > --- > 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 clojure+unsubscr...@googlegroups.com. > 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 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 --- 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 clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.