From 14c009c540faaac1b43161e478a3d9c5aac5ab47 Mon Sep 17 00:00:00 2001 From: Arnaud Bouchez Date: Sat, 26 Aug 2023 13:04:50 +0200 Subject: [PATCH] try to reduce CPU consumption on Windows --- src/mormot.commit.inc | 2 +- src/net/mormot.net.async.pas | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mormot.commit.inc b/src/mormot.commit.inc index d4cfb8389..f426511a5 100644 --- a/src/mormot.commit.inc +++ b/src/mormot.commit.inc @@ -1 +1 @@ -'2.1.5797' +'2.1.5798' diff --git a/src/net/mormot.net.async.pas b/src/net/mormot.net.async.pas index 01d7f6f57..82ae5eb95 100644 --- a/src/net/mormot.net.async.pas +++ b/src/net/mormot.net.async.pas @@ -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;