[jbosscache-dev] JGroups concurrent stack and parallelizing messages from the same sender

Bela Ban bela at jboss.com
Tue May 13 06:39:03 EDT 2008



Manik Surtani wrote:
> The concurrent stack has done a great job in parallelizing delivery of 
> messages from different senders, but is there a way to parallelize 
> this from the same sender as well?  Now I know this doesn't make sense 
> in terms of JGroups messages (order needs to be maintained)

Not necessarily. Sometimes you just want reliable delivery but don't 
care about ordering. To do that and still provide once-only delivery, 
mark your message as OOB (out-of-band):

Message msg=new Message();
msg.setFlag(Message.OOB);  // msg.clearFlag(Message.OOB) clears this 
flag again

OR

use one of the RpcDispatcher.callRemoteMethod(s) methods with the OOB 
parameter set to true.

> but when you consider moving up one level of abstraction in JBC, this 
> causes a bottleneck.  Consider, for example:
>
> 1. Using sync replication and BR.
> 2. 3 threads on cache1, working on disjoint data sets (no contention 
> at all, writes can be in parallel).
> 3. When it comes to replication to the same buddy, the concurrent 
> stack on the receiver will queue the 3 commits.
> 4. All parallelization achieved in 2. above is wasted since the 
> transactions need to queue anyway.

You can use the above mechanism. However, you have to make sure that any 
thread

    * uses synchronous replication
    * the commits are synchronous as well

This won't work for asynchronous replication, but I don't think it is 
needed here anyway right ?


-- 
Bela Ban
Lead JGroups / Clustering Team
JBoss - a division of Red Hat



More information about the jbosscache-dev mailing list