You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/09/27 18:13:20 UTC

qpid-dispatch git commit: DISPATCH-524 - Rotate connectors in the driver to distribute the poll unfairness fairly

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 229250155 -> 5bf550fb2


DISPATCH-524 - Rotate connectors in the driver to distribute the poll unfairness fairly


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/5bf550fb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/5bf550fb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/5bf550fb

Branch: refs/heads/master
Commit: 5bf550fb294cf60f77537928c5c7c07b1679e125
Parents: 2292501
Author: Ted Ross <tr...@redhat.com>
Authored: Tue Sep 27 14:12:00 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Tue Sep 27 14:12:00 2016 -0400

----------------------------------------------------------------------
 src/posix/driver.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5bf550fb/src/posix/driver.c
----------------------------------------------------------------------
diff --git a/src/posix/driver.c b/src/posix/driver.c
index c468bb5..8d82127 100644
--- a/src/posix/driver.c
+++ b/src/posix/driver.c
@@ -938,6 +938,7 @@ static void qdpn_driver_rebuild(qdpn_driver_t *d)
         }
         c = DEQ_NEXT(c);
     }
+
     sys_mutex_unlock(d->lock);
 }
 
@@ -1013,6 +1014,16 @@ int qdpn_driver_wait_3(qdpn_driver_t *d)
         c = DEQ_NEXT(c);
     }
 
+    //
+    // Rotate the head connector to the tail.  This improves the fairness of polling on
+    // open FDs.
+    //
+    c = DEQ_HEAD(d->connectors);
+    if (c) {
+        DEQ_REMOVE_HEAD(d->connectors);
+        DEQ_INSERT_TAIL(d->connectors, c);
+    }
+    
     d->listener_next = DEQ_HEAD(d->listeners);
     d->connector_next = DEQ_HEAD(d->connectors);
     sys_mutex_unlock(d->lock);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org