Re: (con)current confusion

2008-12-17 Thread Raoul Duke
hi, > Got it working! Removed the overzealous use of dosync in defn do-year. Might I beg a small summary write-up of your experience and/or conclusions, recommendations? :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: (con)current confusion

2008-12-17 Thread bOR_
Got it working! Removed the overzealous use of dosync in defn do-year. --~--~-~--~~~---~--~~ 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 To unsubscribe from

Re: (con)current confusion

2008-12-17 Thread bOR_
Hmm. Starting to get it, I think. I now just made a small number of agents, and gave them one function (do-a-years-worth-of-simulations) to compute each. However, that didn't fool them either (still only uses 1 processor), while passing two agents a fibonnaci function does get both processors runn

Re: (con)current confusion

2008-12-14 Thread bOR_
Ok.. seems like the short lifespan of the agent-threads makes it hard for the program to actually start using its (in this case 2) multiple cpu's. The next program has no problem filling both cpu's together for 199% (top, linux), whilst the simulation has trouble getting above 110%, but occasiona

Re: (con)current confusion

2008-12-14 Thread bOR_
The order doesn't matter, and a somewhat mixed order would even be a welcome side-effect of the whole concurrency bit. What does worry me is that the agents are very short-lived. The longest of these tasks takes 0.5msec (any evolution event), so I am not sure if spawning all these agents is worth

Re: (con)current confusion

2008-12-14 Thread Chouser
On Sun, Dec 14, 2008 at 8:49 AM, bOR_ wrote: > > Thanks! Needed only a small change then :) > > (time > (do > (dotimes i popsize >(doseq a [birth death infect infect evolve evolve evolve > evolve evolve] > (send-off (agent i) a))) > (dosync (commute year inc

Re: (con)current confusion

2008-12-14 Thread bOR_
Thanks! Needed only a small change then :) (time (do (dotimes i popsize (doseq a [birth death infect infect evolve evolve evolve evolve evolve] (send-off (agent i) a))) (dosync (commute year inc (report) --~--~-~--~~~---~--~--

Re: (con)current confusion

2008-12-14 Thread Chouser
On Sun, Dec 14, 2008 at 5:48 AM, bOR_ wrote: > > Can anyone tell me what mistake I am making? > > (time > (do > (dotimes i popsize >(send-off (agent i) > (doseq a [birth death infect infect evolve > evolve evolve evolve evolve] (a i > (println "We've send

(con)current confusion

2008-12-14 Thread bOR_
Hi all, I finished porting my model to clojure, and am now trying to get it to run concurrently. During the porting I already to care to wrap the main functions (birth [loc], death [loc] etc) in dosyncs, and all the slots in the world-vector are refs. I've the feeling those are all fine, and I a