Re: Design advice/patterns for Clojure concurrency

2009-04-17 Thread bOR_
> bigfun (comp retire-host slowdown-host infect-hosts naturalrecovery- > host pair-host) > proc1 (future (doseq [i (subvec world 0 2499)] (bigfun i))) > proc2 (future (doseq [i (subvec world 2500 4999)] (bigfun i))) > proc3 (future (doseq [i (subvec world 5000 7499)] (bigfun i))) > proc4 (future

Re: Design advice/patterns for Clojure concurrency

2009-04-17 Thread bOR_
I've written individual-based models using agents, and using refs. Currently my decision tree is 'agents, if there are no events which need to be atomically synchronized between individuals**'. In both cases I had a vector full of individuals called 'world'. When the individuals were agents, I c

Re: Design advice/patterns for Clojure concurrency

2009-04-16 Thread Raoul Duke
>> How do you decide which construct to use for a particular algorithm/ >> program? it would be nifty keen nice if there were some cute visual flow charty representation of people's decision tree? maybe something that can get 'crowd sourced' on some wiki page somewhere. some day. --~--~-

Re: Design advice/patterns for Clojure concurrency

2009-04-16 Thread billh04
On Apr 15, 4:12 pm, Robert Feldt wrote: > Although I understand each of the concurrency "primitives"/systems > (stm, agents, atoms, dynvars) in isolation I find it harder to choose > wisely between them when designing/implementing specific algorithms > and programs. > > Do you have any advice/t

Re: Design advice/patterns for Clojure concurrency

2009-04-15 Thread billh04
On Apr 15, 4:12 pm, Robert Feldt wrote: > Although I understand each of the concurrency "primitives"/systems > (stm, agents, atoms, dynvars) in isolation I find it harder to choose > wisely between them when designing/implementing specific algorithms > and programs. > > Do you have any advice/t

Design advice/patterns for Clojure concurrency

2009-04-15 Thread Robert Feldt
Although I understand each of the concurrency "primitives"/systems (stm, agents, atoms, dynvars) in isolation I find it harder to choose wisely between them when designing/implementing specific algorithms and programs. Do you have any advice/tips for how to choose between Clojure's different conc