Tweaks PAPB polling #533
@ -15,7 +15,6 @@ PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, Storage
|
|||||||
ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
||||||
bool someonesBusy = false;
|
bool someonesBusy = false;
|
||||||
bool vcBusyDuringDump = false;
|
bool vcBusyDuringDump = false;
|
||||||
bool byteFlowControl = false;
|
|
||||||
auto stateHandlingForStore = [&](bool storeIsBusy, DumpContext& ctx) {
|
auto stateHandlingForStore = [&](bool storeIsBusy, DumpContext& ctx) {
|
||||||
if (storeIsBusy) {
|
if (storeIsBusy) {
|
||||||
someonesBusy = true;
|
someonesBusy = true;
|
||||||
@ -26,10 +25,6 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
if (ctx.vcBusyDuringDump) {
|
if (ctx.vcBusyDuringDump) {
|
||||||
vcBusyDuringDump = true;
|
vcBusyDuringDump = true;
|
||||||
}
|
}
|
||||||
if (ctx.dumpedBytes - ctx.bytesDumpedAtLastDelay >= 2048) {
|
|
||||||
byteFlowControl = true;
|
|
||||||
ctx.bytesDumpedAtLastDelay = ctx.dumpedBytes;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
while (true) {
|
while (true) {
|
||||||
if (not cyclicStoreCheck()) {
|
if (not cyclicStoreCheck()) {
|
||||||
@ -45,7 +40,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
TaskFactory::delayTask(100);
|
TaskFactory::delayTask(100);
|
||||||
} else if (vcBusyDuringDump) {
|
} else if (vcBusyDuringDump) {
|
||||||
// TODO: Might not be necessary
|
// TODO: Might not be necessary
|
||||||
TaskFactory::delayTask(20);
|
TaskFactory::delayTask(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,6 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask(
|
|||||||
dumpContext(eventIfDumpDone, eventIfCancelled) {}
|
dumpContext(eventIfDumpDone, eventIfCancelled) {}
|
||||||
|
|
||||||
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
|
||||||
uint32_t delaysVcBusyDuringDump = 0;
|
|
||||||
uint32_t delaysFlowControl = 0;
|
|
||||||
uint32_t delayNotBusy = 0;
|
|
||||||
uint32_t delayHotLoop = 0;
|
|
||||||
while (true) {
|
while (true) {
|
||||||
// Delay done by the check
|
// Delay done by the check
|
||||||
if (not cyclicStoreCheck()) {
|
if (not cyclicStoreCheck()) {
|
||||||
@ -24,21 +19,10 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
bool busy = handleOneStore(storeWithQueue, dumpContext);
|
bool busy = handleOneStore(storeWithQueue, dumpContext);
|
||||||
if (not busy) {
|
if (not busy) {
|
||||||
TaskFactory::delayTask(100);
|
TaskFactory::delayTask(100);
|
||||||
delayNotBusy++;
|
|
||||||
} else if (dumpContext.vcBusyDuringDump) {
|
} else if (dumpContext.vcBusyDuringDump) {
|
||||||
// TODO: Might not be necessary
|
// TODO: Might not be necessary
|
||||||
delaysVcBusyDuringDump++;
|
|
||||||
TaskFactory::delayTask(10);
|
TaskFactory::delayTask(10);
|
||||||
} else {
|
|
||||||
delayHotLoop++;
|
|
||||||
}
|
}
|
||||||
// if ((delaysVcBusyDuringDump + delaysFlowControl + delayNotBusy + delayHotLoop) % 2000 ==
|
|
||||||
// 0) {
|
|
||||||
// sif::debug << "DLY NBUSY: " << delayNotBusy << std::endl;
|
|
||||||
// sif::debug << "DLY FLCTRL: " << delaysFlowControl << std::endl;
|
|
||||||
// sif::debug << "DLY BUSYDUMP: " << delaysVcBusyDuringDump << std::endl;
|
|
||||||
// sif::debug << "DLY HOTLOOP: " << delayHotLoop << std::endl;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user