emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call-process blocks the active thread


From: Philipp Stephani
Subject: Re: call-process blocks the active thread
Date: Fri, 08 Sep 2017 11:27:29 +0000



Elias Mårtenson <address@hidden> schrieb am Fr., 8. Sep. 2017 um 13:00 Uhr:
On 8 September 2017 at 15:01, Eli Zaretskii <address@hidden> wrote:
> From: Elias Mårtenson <address@hidden>
> Date: Fri, 8 Sep 2017 11:00:42 +0800
>
> As it turns out, ‘call-process’ hangs all of Emacs while the external program is run.

No, it hangs the calling thread, and the other threads wait for the
calling thread to yield.  To avoid that, use start-process instead.

This is not a bug.

I'm not entirely sure why you feel that distinction is important. At the end of the day, it's ‘start-process’ that doesn't yield while the external process runs. Is there a reason why it can't be changed so that it does?

Emacs threads can't run in parallel because they share global mutable state (buffers etc.) without synchronization. `call-process' is guaranteed to not affect the global state in "significant" ways, therefore it can't yield to threads that could change the global state.
It's not possible to fix this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]