Reorder process of queues in TagQueue::runEpoch
This commit is contained in:
parent
0203c93a44
commit
c29213eec2
|
@ -64,26 +64,6 @@ void TagQueue::runEpoch(double elapsed,
|
|||
SpannedDeque<GetReadVersionRequest>& outImmediatePriority) {
|
||||
startEpoch();
|
||||
Deque<DelayedRequest> newDelayedRequests;
|
||||
while (!newRequests.empty()) {
|
||||
auto const& req = newRequests.front();
|
||||
if (canStart(req)) {
|
||||
for (const auto& [tag, count] : req.tags) {
|
||||
releasedInEpoch[tag] += count;
|
||||
}
|
||||
if (req.priority == TransactionPriority::BATCH) {
|
||||
outBatchPriority.push_back(req);
|
||||
} else if (req.priority == TransactionPriority::DEFAULT) {
|
||||
outDefaultPriority.push_back(req);
|
||||
} else if (req.priority == TransactionPriority::IMMEDIATE) {
|
||||
outImmediatePriority.push_back(req);
|
||||
} else {
|
||||
ASSERT(false);
|
||||
}
|
||||
} else {
|
||||
newDelayedRequests.emplace_back(req);
|
||||
}
|
||||
newRequests.pop_front();
|
||||
}
|
||||
|
||||
while (!delayedRequests.empty()) {
|
||||
auto const& delayedReq = delayedRequests.front();
|
||||
|
@ -107,6 +87,27 @@ void TagQueue::runEpoch(double elapsed,
|
|||
delayedRequests.pop_front();
|
||||
}
|
||||
|
||||
while (!newRequests.empty()) {
|
||||
auto const& req = newRequests.front();
|
||||
if (canStart(req)) {
|
||||
for (const auto& [tag, count] : req.tags) {
|
||||
releasedInEpoch[tag] += count;
|
||||
}
|
||||
if (req.priority == TransactionPriority::BATCH) {
|
||||
outBatchPriority.push_back(req);
|
||||
} else if (req.priority == TransactionPriority::DEFAULT) {
|
||||
outDefaultPriority.push_back(req);
|
||||
} else if (req.priority == TransactionPriority::IMMEDIATE) {
|
||||
outImmediatePriority.push_back(req);
|
||||
} else {
|
||||
ASSERT(false);
|
||||
}
|
||||
} else {
|
||||
newDelayedRequests.emplace_back(req);
|
||||
}
|
||||
newRequests.pop_front();
|
||||
}
|
||||
|
||||
delayedRequests = std::move(newDelayedRequests);
|
||||
endEpoch(elapsed);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue