[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Non atomic issue with paging

clebert.suconic@jboss.com do-not-reply at jboss.com
Mon Dec 22 01:48:13 EST 2008


"timfox" wrote : 
  | Since isPaging() and addSize() are not done together as an atomic operation, it is possible that many threads could call isPaging() at the same time and return false to all of them.

The way it works is...

We aways call page(Message) before routing...

if (!page(Message))
{
     route();
     addSize(....);
}

addSize is what starts the page-mode, and addSize is only called after routing. Meaning that anything after that will be routed.

You could eventually have simultaneous threads overlapping the maxSize... but I'm not sure if the cost of synchronizing this would be worth.

We could maybe add another check on the last addSize. But i don't want to add any synchronization on this.


I can double check this after Xmas.

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

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



More information about the jboss-dev-forums mailing list