[PJUG Javamail] super fast reentrant queues?

Joe Hoffman joe at intelopment.com
Tue Sep 22 14:39:26 EDT 2009


Dean,
When you refer to 'queues', are you using JMS queues?

joe
On Sep 22, 2009, at 11:12 AM, 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:
>
> I have one reader thread, and multiple ~(3-15) builder threads.  The  
> reader thread first pulls a packet off of the network card, and puts  
> it in the queue of the first builder.  That first builder takes a  
> packet off its queue, does some analysis on it, then based on that  
> analysis it might send that packet to one or more of the other  
> builders.  In this model, any given queue has at least one thread  
> writing to it, and a single thread reading from it.
>
> Pretty basic producer/consumer type threading issue, and I could  
> easily (and did!) write a queuing system that "works", but since I  
> am a completely self taught java programmer, I realize I might have  
> overlooked a more simple/efficient/safe way of doing things.  Any  
> advice?  Thanks.
>
>    - DEAN
> _______________________________________________
> Web Site - http://www.pjug.org/
> Javamail mailing list
> Javamail at pjug.org
> http://www.pjug.org/mailman/listinfo/javamail



More information about the Javamail mailing list