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 <[email protected]> Authored: Tue Sep 27 14:12:00 2016 -0400 Committer: Ted Ross <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
