[concurrency-interest] ThreadPoolExecutor

David Holmes dholmes at dltech.com.au
Fri Oct 7 01:03:56 EDT 2005

I wrote:
> I'm intrigued enough to try and implement that dual queue set up. :)

Well the basic idea seems sound but the details are a bit tricky. To do the
queue switching you need atomicity otherwise the possible states are too
numerous for me to work out how to handle them. :) But atomicity at the
dual-queue level conflicts with the normal synchronization of the
SynchronousQueue and LinkedBlockingQueue (imagine trying to add a
synchronized wrapper to them: you hold the outer lock while blocked waiting
for space/elements). So the queue would have to be fully custom implemented,
rather than wrapping existing queue implementations. :(

David Holmes

More information about the Concurrency-interest mailing list