Ganesh Murthy created DISPATCH-888:
--------------------------------------
Summary: Balanced distribution algorithm visits each link to
determine the best_eligible_link
Key: DISPATCH-888
URL: https://issues.apache.org/jira/browse/DISPATCH-888
Project: Qpid Dispatch
Issue Type: Improvement
Components: Container
Affects Versions: 1.0.0
Reporter: Ganesh Murthy
Assignee: Ganesh Murthy
Priority: Minor
Fix For: 1.1.0
1. In forwarder.c the loop that selects the best_eligible_link loops thru all
rlinks as seen below
{noformat}
while (link_ref) {
qdr_link_t *link = link_ref->link;
uint32_t value = DEQ_SIZE(link->undelivered) +
DEQ_SIZE(link->unsettled);
bool eligible = link->capacity > value;
//
// If this is the best eligible link so far, record the fact.
// Otherwise, if this is the best ineligible link, make note of that.
//
if (eligible && eligible_link_value > value) {
best_eligible_link = link;
eligible_link_value = value;
} else if (!eligible && ineligible_link_value > value) {
best_ineligible_link = link;
ineligible_link_value = value;
}
link_ref = DEQ_NEXT(link_ref);
}
{noformat}
Instead the code can exit the loop if the value is 0 (zero). When there are no
outstanding deliveries on a link we can without doubt choose that link as the
best one to send the delivery.
2. Rotate the rlinks list only if value is zero to avoid frequent list
rotation. In the synchronous case, the code still works.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]