java.util.concurrent.LinkedBlockingQueue<E>

Check out the put() method.  That what I used for a program similar to
the original poster when I needed control over the number of threads.

On Jan 28, 7:15 pm, Paul  Mooser <taron...@gmail.com> wrote:
> This is something I run into with executors in Java periodically - I
> have never understood why there isn't a default implementation
> provided which has a blocking queue for tasks which will block on
> submission to the queue if it is full. If I'm not mistaken, the
> default ones which use bounded blocking queues throw rejected
> execution exceptions if you submit too many tasks, or just let the
> queue grow without bounds.
>
> It should be relatively easy to set up an executor with that behavior,
> which would make it fairly easy to not produce things "too far" ahead
> of consumption.
>
> On Jan 28, 6:53 am, Timothy Pratley <timothyprat...@gmail.com> wrote:
>
> > pooledExecutor is just a standard java fixed size thread pool based
> > upon the number of processors available, so it will only create X
> > threads at a time. However I believe that submitted jobs are queued so
> > if your seq processing can get too far ahead you would end up with a
> > very full queue. I'm sure there must be a way to limit the submission
> > rate but can't think of it right now maybe someone else will chime in

-- 
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

Reply via email to