[PJUG Javamail] super fast reentrant queues?

Derek Chiles pjug.org at derekchiles.net
Tue Sep 22 14:53:46 EDT 2009


Hi Dean,

On Sep 22, 2009, at 19:12 GMT+01:00, pierce403 at gmail.com wrote:

> I have a bit of an academic question for the group.  What would you  
> say is the most efficient method of implementing shared/reentrant  
> queues?  I am in the midst of optimizing some packet sniffing code I  
> wrote a while back.  The model looks like this:

You almost certainly want to use the java.util.concurrent package for  
the building blocks of your concurrent application, including  
concurrent queues.

Specifically you may want to look at ConcurrentLinkedQueue or  
LinkedBlockingQueue. I would test with both to see which performs  
better in your application.

	http://java.sun.com/javase/6/docs/api/java/util/concurrent/package-summary.html

If you plan to continue writing concurrent Java code, you may want to  
check out _Java_Concurrency_in_Practice_ by Brian Goetz et al.

	http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601

cheers,
Derek



More information about the Javamail mailing list