> *Executors/newCachedThreadPool* works exactly as I 'd want without the
> risk of overwhelming the system with threads (which the fixed-size pool
> will if I initialize it with (count coll))...
>
You will either ovewhelm the system with threads or have the tasks waiting
in the queue, there is no escaping it. For example:
(pool-map #(do (Thread/sleep %) %)
(concat (repeat 1000 100) (repeat 100 1)))
prints
(100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100
100 100 ...)
meaning none of the fast tasks got to execute before at least some of the
long tasks had already completed.
--
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