Before we used a counter which allowed inner loops to shortcut and rarely reach ProcessSleepFibers call in high I/O situations.
Now, we also call ProcessSleepFibers when we process I/O completions that provides a good balance between responsiveness and the maintenance cost of checking for starvation.
Results:
Before I could observe delays reaching 2seconds between Heartbeat runs that where scheduled to run every 10ms (on highly loaded server in debug mode).
After: the delays have not crossed 40ms under the same conditions.
Before we used a counter which allowed inner loops to shortcut and rarely reach ProcessSleepFibers call in high I/O situations.
Now, we also call ProcessSleepFibers when we process I/O completions that provides a good balance between responsiveness and the maintenance cost of checking for starvation.
Results:
Before I could observe delays reaching 2seconds between Heartbeat runs that where scheduled to run every 10ms (on highly loaded server in debug mode).
After: the delays have not crossed 40ms under the same conditions.