[concurrency-interest] ConcurrentLinkedBlockingQueue ?
hanson.char at gmail.com
Sat Apr 7 19:17:25 EDT 2007
>So it is more likely that we'll
>put out a separate ConcurrentLinkedBlockingQueue that will be
>preferable to LinkedBlockingQueue unless you need capacity constraints.
I've been asked recently (again) if the proposed CLBQ in it's current form
is ready to be included into Java 7.
What do you think ?
PS: Test harness comparing CLBQ and LBQ:
On 9/7/06, Doug Lea <dl at cs.oswego.edu> wrote:
> Hanson Char wrote:
> > Hi,
> > I've been wondering why there is ConcurrentLinkedQueue in Java 5+, but
> > not something like a ConcurrentLinkedBlockingQueue, which would allow
> > the client to block on an empty queue via a "take" method, or block on
> > an empty for a limited time via a "poll" method.
> This IS a good thought.
> > Please find below an attempt to build such queue on other existing
> > structures.
> > Any concurrency problem with these classes ? Is there a better way ?
> This way works, but reduces concurrency by using a single semaphore,
> so is a bit less scalable than current LinkedBlockingQueue. However,
> there is a path to much better scalability by using the "dual-queue"
> approach similar to what we did for Java 6 SynchronousQueue.
> My initial intent was to find a way to internally use such
> techniques to replace the unbounded case of LinkedBlockingQueue.
> But this turns out not to work out too well because of all the
> little compatibility problems encountered -- for example, maintaining
> the same Serialization form. So it is more likely that we'll
> put out a separate ConcurrentLinkedBlockingQueue that will be
> preferable to LinkedBlockingQueue unless you need capacity constraints.
> Stay tuned for it...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest