Re: ref-history-count always return 0?

2013-06-03 Thread Colin Fleming
b.com/Chouser/456326 to >> > study how the history in refs works. See the accompanying discussion at >> > http://clojure-log.n01se.net/date/2010-06-28.html. I've been using >> variants >> > of that stress test to explain the ref history behavior since then and &g

Re: ref-history-count always return 0?

2013-06-03 Thread Tom Van Cutsem
ay want to use the code from https://gist.github.com/Chouser/456326to > > study how the history in refs works. See the accompanying discussion at > > http://clojure-log.n01se.net/date/2010-06-28.html. I've been using > variants > > of that stress test to explain the ref history

Re: ref-history-count always return 0?

2013-06-02 Thread Michał Marczyk
refs works. See the accompanying discussion at > http://clojure-log.n01se.net/date/2010-06-28.html. I've been using variants > of that stress test to explain the ref history behavior since then and > people seem to be happy with it. > > Kudos to chouser obviously! > >

Re: ref-history-count always return 0?

2013-05-31 Thread Stefan Kamphausen
You may want to use the code from https://gist.github.com/Chouser/456326 to study how the history in refs works. See the accompanying discussion at http://clojure-log.n01se.net/date/2010-06-28.html. I've been using variants of that stress test to explain the ref history behavior since

Re: ref-history-count always return 0?

2013-05-30 Thread Josh Kamau
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 wrote: > > On Thu, May 30

Re: ref-history-count always return 0?

2013-05-30 Thread Neale Swinnerton
On Thu, May 30, 2013 at 3:05 PM, Josh Kamau 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

Re: ref-history-count always return 0?

2013-05-30 Thread xumingmingv
ref-count only increment when one of the following occurs: * min-history > 0 * ref-read-faults > 0 && current-ref-history-count < max-history-count. ;; ref-count increment because min-history > 0 (let [r (ref 1 :min-history 1) f1 (future (dosyn

ref-history-count always return 0?

2013-05-30 Thread Josh Kamau
(def my-ref (ref 1)) (defn update-my-ref [new-value] (dosync (alter my-ref #(+ % new-value)) (ref-history-count my-ref))) Hi guys ; 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,

Re: Ref history

2010-01-10 Thread Krukow
On Jan 10, 6:21 pm, Dragan Djuric wrote: > Is this on purpose (and what is the reason), or it's just that nobody > thought that would be useful? > > Of course, I am talking about the read-only access to the history. [snip...] To minimize memory consumption, refs only keep history if it is neede

Re: Ref history

2010-01-10 Thread ataggart
On Jan 10, 9:21 am, Dragan Djuric wrote: > I am aware that there are functions for seeing history count, min > count etc. > Why is the actual history hidden? > For example, if there is a ref: > (def a (ref 1)) > (dosync (alter a 2)) > (dosync (alter a 3)) > (ref-history-

Ref history

2010-01-10 Thread Dragan Djuric
I am aware that there are functions for seeing history count, min count etc. Why is the actual history hidden? For example, if there is a ref: (def a (ref 1)) (dosync (alter a 2)) (dosync (alter a 3)) (ref-history-ocunt a) =>2 a =>3 Why this is not allowed?: (ref-history a) => (2 1)