[concurrency-interest] BoundedPriorityBlockingQueue ?

Hanson Char hanson.char at gmail.com
Tue Sep 12 21:25:22 EDT 2006


Hi David,

I suppose you mean PBQ (as opposed to BPBQ which doesn't yet exist) already
has the necessary API.

True.  However, although there are both the blocking "put" and non-blocking
"offer" methods in PBQ, the blocking "put" as at now never blocks and the
non-blocking "offer" always return true (ie succeed) because PBQ is
unbounded!

What I am suggesting is that if we implemented something like a Bounded PBQ
(BPBQ), then we could "meaningfully" make "offer" return false when the
queue is full (and true otherwise).  Since the return type of "put" is void,
we can throw something like a QueueFullException when the queue is full.

"meaningful" or not, of course, depends whether such BPBQ is considered
useful, which I don't know.

Hanson

On 9/12/06, David Holmes <dcholmes at optusnet.com.au> wrote:
>
>  Sorry Hanson, I know you weren't the originator here.
>
> What I failed to say, in response to your comments regarding return values
> or exceptions is that BPBQ already has the necessary API's - there are
> blocking and non-blocking forms of "put" and "take" so the application can
> already choose to use non-blocking forms if they want to deal with a full
> queue.
>
> Cheers,
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20060912/c7e8ad9c/attachment.html 


More information about the Concurrency-interest mailing list