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
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
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
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
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
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
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)
--~--~-~--~~~---~--~--
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
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