Ahh ok. I had read following text on http://clojure.org/agents "Note that use of Agents starts a pool of non-daemon background threads that will prevent shutdown of the JVM. Use shutdown-agents<http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/send-off> to terminate these threads and allow shutdown."
That is the reason I though the agents consume some system ressources, even when they do nothing, and I realy had the assumption somehow that every agents has it's own Thread. :( 2012/4/12 Stefan Kamphausen <[email protected]> > Hi, > > > On Wednesday, April 11, 2012 8:27:26 PM UTC+2, Goldritter wrote: >> >> >> Another thing about the posted code here. >> When the alogrithm is stopped, the start-stop-agent became the state >> "stopped". Because this agent has not the state "running" anymore, there >> is no send for any other agent anymore. But these agents are available >> and "running" correct? Does these unused agents use up any System >> ressources? >> > > what exactly do you mean? The agents are still within scope and thus > reachable and won't be garbage collected. They will consume some memory. > However, since no update function is sent to the agents anymore, they don't > consume any CPU cycles. > > All update functions sent to all agents (using `send') will be run on a > dedicated thread-pool. No agent has its own thread. Maybe this is your > misunderstanding? > > > Kind regards, > Stefan > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
