From 8261ba69e654814671d19a2cf17644330387c7c8 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 23 Jun 2017 13:21:50 +0100 Subject: readline_buffer: fix busy wait It'd eat up a core constantly, due to spending its time jumping back and forth between userland and kernel. We now wait for up to a millisecond in kernel, which will be transparent to the user and drop to idle most of the time. --- contrib/epee/src/readline_buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/epee/src/readline_buffer.cpp') diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp index 68b739db9..a06eb4f04 100644 --- a/contrib/epee/src/readline_buffer.cpp +++ b/contrib/epee/src/readline_buffer.cpp @@ -122,7 +122,7 @@ static int process_input() struct timeval t; t.tv_sec = 0; - t.tv_usec = 0; + t.tv_usec = 1000; FD_ZERO(&fds); FD_SET(STDIN_FILENO, &fds); -- cgit v1.2.3