Re: Architecting a large multi-threaded process
>From Mark Volkmann tutorial - http://java.ociweb.com/mark/clojure/article.html "The send function uses a "fixed thread pool" (see the newFixedThreadPool method in java.util.concurrent.Executors) where the number of threads is the number of processors plus two. If all of those threads are busy, the action doesn't run until one becomes available. The send-off function uses a "cached thread pool" (see the newCachedThreadPool method where existing threads in the pool are used if available and new threads are added otherwise." Is it possible to set the size of the cached thread pool? If so, it might solve your problem. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Architecting a large multi-threaded process
> What I want is some way to schedule tasks to be executed by some set > of worker threads, and then be able to control the number of worker > threads on a server. What I'm interested in is other people's > opinions on how I should architect this app. This is exactly what we (a colleague and me) did with a large C++ app and it works perfectly One of the advantages I see in clojure is the built-in support for concurrency. If I would feel that this support would not be suitable for the given task I would definitely choose Java with the java.util.concurrent package. Regards Roger --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Architecting a large multi-threaded process
You might want to look into the stuff from JSR166 (scheduled for Java 7, but already available as a library for Java 6), which has advanced, built-in workload-balancing which is vastly easier than trying to do this with the raw, naive j.u.c.Executors-package (and Clojure's agents, which are backed by j.u.c). Clojure-core even supports this library via the clojure.parallel namespace. I remember reading something about the status of support for this, but I don't recall exactly what it was. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---