Skip to content

Commit

Permalink
try to reduce CPU consumption on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Aug 26, 2023
1 parent a8ddcc3 commit 14c009c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
@@ -1 +1 @@
'2.1.5797'
'2.1.5798'
6 changes: 5 additions & 1 deletion src/net/mormot.net.async.pas
Expand Up @@ -1842,7 +1842,11 @@ procedure TAsyncConnectionsThread.Execute;
// main thread will just fill pending events from socket polls
// (no process because a faulty service would delay all reading)
begin
start := 0;
{$ifdef OSWINDOWS}
start := -1; // ensure never SleepHiRes(0)
{$else}
start := 0; // best reactivity
{$endif OSWINDOWS}
while not Terminated do
begin
fWaitForReadPending := false;
Expand Down

0 comments on commit 14c009c

Please sign in to comment.