[concurrency-interest] Queue throughput

Jean Morissette jean.morissette666@videotron.ca
Fri, 05 Nov 2004 00:28:32 -0500


Hi,
In SMP environment, what are the expected methods of class 
LinkedBlockingQueue that should give the highest throughput for 
producer/consumer application?  The only constraint is that objects must 
be enqueued only one at time (no call to addAll()).

Javadoc of BlockingQueue interface says about drainTo that "this 
operation may be more efficient than repeatedly polling this queue".  Is 
it really more efficient for LinkedBlockingQueue class?  It seem to me 
that 'drainTo' can reduce throughput (compared to poll method) because 
it acquire also the "putLock".

Thanks
Jean