[concurrency-interest] Queue.setCapacity

Doug Lea dl@cs.oswego.edu
Sun, 28 Nov 2004 18:59:32 -0500


> Is it possible to create classes similar to ConcurrentLinkedQueue,
> LinkedBlockingQueue and ArrayBlockingQueue that could support
> Queue.setCapacity method to change dynamically the capacity of a
> queue?

Well, I suppose anything is possible, depending on how much overhead
and recoding you are prepared to accept. Of these though, only the
implementation of LinkedBlockingQueue could be changed to allow
dynamic capacity changes without major surgery or performance
degradations. (And even this would take some hard work and would lose
some performance.)

-Doug