commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <pj...@sfaf.org>
Subject RE: [collections] vs [threading] - Queue
Date Mon, 22 Jul 2002 16:44:28 GMT
> The threading sandboxed package has a set of Queue methods 
> that are thread safe.
> 
> Are these better placed in Collections? The only problem 
> being that they would be dependent on threading for the 
> use of the Counter.
>
> Apologies if this has already been discussed, just an idea I had while
> browsing the commons files.

Well, Collections has its own queue stuff now (check the 
current CVS version).  They're not called queues though.

The interface which defines a queue-like thing is 
Buffer, and it has four implementations:

BoundedFifoBuffer
UnboundedFifoBuffer
ArrayStack
BinaryHeap

In addition, BufferUtils contains utility methods, two
of which relate to making a Buffer implementation thread-safe:

BufferUtils.synchronizedBuffer(Buffer);
BufferUtils.blockingBuffer(Buffer);

I think BufferUtils.blockingBuffer(Buffer) results in something
very similar to the Queue implementations in threading, but
I haven't looked too closely.

-Paul

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message