Repository navigation
Stop the idle loop in Main from polling every millisecond - #20
Merged
Merged
Conversation
The loop that waits for Program.Exit used Task.Delay(1) followed by Task.Yield(), which woke the thread pool about a thousand times a second. An idle atlasd (no clients connected) used about 32% of a core on macOS/.NET 10; with a 250ms delay it uses about 1.3%. Shutdown reacts within 250ms. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
NullTimer sends SID_NULL every 60 seconds and PingTimer sends SID_PING every 180 seconds, but both fired every 100ms, and PingTimer reads a setting and allocates a message and a Random on every tick. A one second period is still far finer than the intervals they enforce. Idle atlasd (no clients, 250ms idle loop) went from about 1.5% of a core to about 0.5%. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
wjlafrance
force-pushed
the
fix/idle-loop-cpu
branch
from
October 9, 2026 02:47
389523d to
c63c4c6
Compare
carlbennett
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The loop that waits for Program.Exit used Task.Delay(1) followed by Task.Yield(), which woke the thread pool about a thousand times a second. An idle atlasd (no clients connected) used about 32% of a core on macOS/.NET 10; with a 250ms delay it uses about 1.3%. Shutdown reacts within 250ms.