Add ITERATIONS_PER_REACTOR_CHECK

This commit is contained in:
sfc-gh-tclinkenbeard 2022-01-01 20:14:57 -08:00
parent 2ad8955dd3
commit 8076806e76
3 changed files with 4 additions and 2 deletions

View File

@ -171,6 +171,7 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) {
init( MIN_LOGGED_PRIORITY_BUSY_FRACTION, 0.05 );
init( CERT_FILE_MAX_SIZE, 5 * 1024 * 1024 );
init( READY_QUEUE_RESERVED_SIZE, 8192 );
init( ITERATIONS_PER_REACTOR_CHECK, 5 );
//Network
init( PACKET_LIMIT, 100LL<<20 );

View File

@ -226,6 +226,7 @@ public:
double MIN_LOGGED_PRIORITY_BUSY_FRACTION;
int CERT_FILE_MAX_SIZE;
int READY_QUEUE_RESERVED_SIZE;
int ITERATIONS_PER_REACTOR_CHECK;
// Network
int64_t PACKET_LIMIT;

View File

@ -1533,8 +1533,8 @@ void Net2::run() {
minTaskID = currentTaskID;
}
// attempt to empty out the IO backlog for every 5 tasks while in this loop
if (ready.size() % 5 == 1) {
// attempt to empty out the IO backlog
if (ready.size() % FLOW_KNOBS->ITERATIONS_PER_REACTOR_CHECK == 1) {
if (runFunc) {
runFunc();
}