Hmmm....interesting thoughts...
I was under the impression that that agents are asynchronous and thus
do not depend on the STM , which is only for co-ordinated change! There
is a dedicated Thread pool where agents are assigned separate threads
for their work.You seem to suggest otherwise...I guess i 'll have to
resort to my Clojure books...perhaps we could post a new question with
different title here on the group...I'm sure more experienced people can
answer that with not much time spent...
Bottom line is that unless i use pmap i run the risk of running out of
memory...presumably it's the same for you.
Jim
On 03/04/12 17:16, Marcus Lindner wrote:
Maybe the reason is the STM.
If I rmember it correctly, then agents and refs are controlled by
Clojures STM mechanic. Eventuelly the us of map increase the work for
the STM and so it needs more time to schedule all the agent calls and
this result in a higher memory usage.
When you use pmap the calls are working in parallel and the STM might
have less agents calls to schedule and this might reduce the stress.
On the otherside, the work the agents have do to is not so hard and
the STM might shine in comparison to pmap or other parallel calls if
there is much more work to do.
But these are only guesses...
--
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
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en