Re: STM and useful concurrency

2009-03-24 Thread Tom Davies
I think Cliff may mean that each STM-participating memory access is 3x slower, but in Clojure, because of immutability, a very small proportion of accesses are Ref accesses, whereas in C/C++ *all* memory accesses would be. I agree that there's lots of room for adding instrumentation to Clojure's

STM implementation question

2009-03-23 Thread Tom Davies
I'm struggling to understand the following lines of code from clojure.lang.LockingTransaction.run: if (ref.tvals == null) { ref.tvals = new Ref.TVal(e.getValue(), commitPoint, msecs); } else if (ref.faults.get() > 0) {

Re: Ants and agents

2008-10-30 Thread Tom Davies
On Oct 30, 7:14 pm, Konrad Hinsen <[EMAIL PROTECTED]> wrote: > Then every iteration of ant behaviour (and evaporation etc.) creates   > a new thread, right? This implies that an agent is not forever bound   > to the same thread. Nor is a thread bound to one agent, as otherwise   > one could iter

Re: Ants and agents

2008-10-29 Thread Tom Davies
On Oct 30, 12:14 pm, "Jim Menard" <[EMAIL PROTECTED]> wrote: > I was looking at the same code today. My question is slightly > different. In the code > > (defn evaporation [x] >   (when running >     (send-off *agent* #'evaporation)) >   (evaporate) >   (. Thread (sleep evap-sleep-ms)) >   nil)

Re: Refs and ensure

2008-10-15 Thread Tom Davies
In relational database terms, Clojure's STM has 'read-committed' isolation when you don't use 'ensure', then? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj