[concurrency-interest] LBQ vs CLBQ

Szabolcs Ferenczi szabolcs.ferenczi at gmail.com
Wed Apr 4 17:23:23 EDT 2007

On 04/04/07, Hanson Char <hanson.char at gmail.com> wrote:

> > the put method is not implemented with the semantics as defined in the
> > BlockingQueue interface.
> Why not ?  Can you please elaborate ?

The description of the put for the BlockingQueue interface says:
"Inserts the specified element into this queue, waiting if necessary
for space to become available." In the CLBQ implementation, however,
the put is implemented by a forwarded call to the add method of the
ConcurrentLinkedQueue member. The add is a non-blocking method, it
"Inserts the specified element at the tail of this queue." and returns
a boolean. Thus, no waiting is there behind the add method which is
required for the put method whenever the queue is at the limit of its
capacity. Does this help?

Best Regards,

More information about the Concurrency-interest mailing list