[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: JBoss 2.0 Thread model

david.lloyd@jboss.com do-not-reply at jboss.com
Tue Apr 1 13:27:47 EDT 2008


"timfox" wrote : One way of implementing this is having a set of BlockingQueues one for each "id" value.
  | 
  | Then you have a pool of workers that poll on these queues.
  | 
  | This is basically how a ThreadPoolExecutor works, but instead of a single queue feeding it, you have many queues.
  | 
  | I'd take a look at what Trustin has done in org.apache.mina.filter.executor.OrderedThreadPoolExecutor (which works similarly to how I've described)
  | 
  | You want to avoid having one thread per id value since you may have many thousands of id values.

This is essentially what I've done.  My OrderedExecutorFactory is much simpler than the one in MINA (there's some IoSession-specific stuff in theirs so you can't really use it verbatim; mine is generic).

Since the link seems to have gotten "killed" in your "editing" session, here it is again: http://tinyurl.com/33b4gq

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140655#4140655

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140655



More information about the jboss-dev-forums mailing list