Subject: bug#33018: 26.1.50; thread starvation with async processes and accept-process-output

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sun, 14 Oct 2018 16:00:56 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: "Basil L. Contovounesios" <[email-masked]>
>> Date: Thu, 11 Oct 2018 15:57:50 +0100
>> 
>> I attach a sample program test.el whose central function, test-slave,
>> invokes wget asynchronously before waiting for the process to exit.
>> 
>> The issue I'm facing is that running test-slave twice in succession,
>> each time in a new thread, causes accept-process-output to hang with no
>> output (unless a timeout argument is given, in which case the function
>> returns nil) the second time around.
>
> When the hang happens, is there any wget process still alive, or did
> they all exit?  Please use OS tools to find that out, don't rely on
> what Emacs thinks.

When the hang happens, the wget process launched by the waiting thread
is still alive but asleep (idle), as reported by ps and top.

-- 
Basil