1 Reply Latest reply on Jun 10, 2005 10:50 AM by ben.wang

    Reduce frequency of calls to BoundedBuffer.size() in Region.

      Hi;

      I've opened up an issue in Jira to request a change to reduce the freqency of calls to BoundedBuffer.size() in Region.putNodeEvent().

      http://jira.jboss.com/jira/browse/JBCACHE-190

      The problem is that BoundedBuffer.size() is not a cheap call - requires a lock acquisition - and since there is high contention for this object across threads, this leads to concurrency problems.

      I've attached an enhanced Region.java file that makes the call only once every 100 calls.

      Brian.

        • 1. Re: Reduce frequency of calls to BoundedBuffer.size() in Reg

          Brian,

          Looks like a good suggestion. But I will make a minor correction to your patch by subtracting the THRESHOLD for another 100 to guard against the overflow, just in case.

          BTW, it seems you have some profiling information. Would you mind to share it with us. If you prefer, my email address is ben.wang at jboss dot com.

          Thanks,

          -Ben