Quantcast
Channel: Race condition in Clojure stm? - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Jarlax for Race condition in Clojure stm?

Let's look at example:(defn test-trans [] (let [x (ref 1) t-inc #(dosync (alter x inc)) t-mul #(dosync (alter x (partial * 2))) fns (flatten (repeat 10 [t-mul t-inc]))] (last (pmap (fn [f] (f)) fns))...

View Article


Race condition in Clojure stm?

Hello I was reading the book joy of clojure and in the section about the STM they have an image of 2 transactions where A is initially retrieving the same value from a ref as B is and then both...

View Article

Browsing latest articles
Browse All 2 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>