"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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...