Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2076

TransferQueueBundler: bundler thread should remove chunks of messages

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.6.10, 4.0
    • Labels:
      None

      Description

      Currently, the bundler thread in TransferQueueBundler removes messages from the queue one by one:

      while(null != (msg=queue.poll())) {
          long size=msg.size();
          if(count + size >= transport.getMaxBundleSize())
              sendBundledMessages();
          addMessage(msg, size);
      }
      

      This is inefficient, as we need to acquire the lock on ArrayBlockingQueue every time. ArrayBlockingQueue.drainTo() should be used instead, to remove as many messages as are in the queue with one lock acquisition.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                belaban Bela Ban
                Reporter:
                belaban Bela Ban
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: