Subject: bug#78499: tramp-accept-process-output busy-waits

From: Daniel Colascione <[email-masked]>
Date: Thu, 22 May 2025 03:43:24 -0400

On May 21, 2025 3:47:14 AM EDT, Michael Albinus <[email-masked]> wrote:
>Daniel Colascione <[email-masked]> writes:
>
>Hi Daniel,
>
>> tramp-accept-process-output should wait for something to actually happen
>> to the process from which we're trying to accept output, not just return
>> immediately after specifying a zero timeout and rely on the caller
>> to poll.
>
>tramp-accept-process-output has seen several implementation iterations
>ove the years. I'm happy, that it looks stable now.
>
>Could you please show a problem with the current implementation, which
>needs to be fixed?
.
100% CPU use while we're waiting to receive bytes from the peer is a priori a problem that needs to be fixed. Good software doesn't busy wait. We have a perfectly good mechanism for waiting for something to happen with timeouts and we shouldn't avoid them on account of years of accumulated changes or compatibility with ancient and irrelevant bugs.