Skip to content
Snippets Groups Projects
Commit 2e847de9 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

It was observed that httpSess threads would consume ~15% of a CPU

Using Linux top, long-running (hundreds of hours) httpSess threads were seen
consuming ~15% of a CPU core. This loop calls time() and yield() in a tight
loop, so instead mswait(50) (milliseconds), which reduces the CPU utilization
considerable (down to < 1%), but will slightly impact the frequency with
which the events callbacks are invoked. A better scheme would be to block
while waiting for an event or a timeout (e.g. 1 second), so this is not a
great solution. More of a work-around.
parent 1036e892
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -53,6 +53,6 @@ while (client.socket.is_connected) {
delete callbacks[e];
}
});
yield();
mswait(50);
ping();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment