On Jan 30, 8:09 am, Timothy Pratley <timothyprat...@gmail.com> wrote: > Below I present 'submit-future' which is similar to the existing > 'future' call in that it spawns a thread to execute a task, but > differs in that it will block if n submitted futures are already > running, where n is the number of available processors. I think this > could be quite handy for the producer-consumer model which lazy-seq > lends itself to, allowing one to write:
This looks like it could become really useful in the future (no pun intended), thanks for sharing! Instead of enforcing its own thread count limit, however, it might be worthwhile to interface with the Agent thread pool. Otherwise, in the worst case a machine with N cores could try to run N+2 agent threads and N+2 future-submit threads at once. That said, I'm not sure about the consequences of the Agent thread pool being saturated by copious use of future-submit. -- 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