[concurrency-interest] Re: SynchronousQueue to use a LIFO for waitingTakes?

Larry Riedel larryr@saturn.sdsu.edu
3 Feb 2004 17:53:44 -0000

> unlike dl.util.concurrent, we can't leave the insides of the
> j.u.c.SynchronousQueue class open enough for people to make
> simple subclasses etc to get this effect.

What is it that distinguishes j.u.c classes so?

> the only reasonable alternative is to make LIFO/FIFO
> selectable in a new SynchronousQueue constructor.

Assuming having different classes representing different
combinations of orthogonal aspects of behavior is
undesirable or unacceptable, I think it might be nice to
have something like a setQueueingStrategy method, maybe
from an interface indicating that classes which implement
that interface have some queue style look and feel but
are not partial to a particular queueing strategy.  But
then again PriorityBlockingQueue vs LinkedBlockingQueue
gives me the impression that having different classes to
support orthogonal behavior /is/ acceptable....