unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: "Elias Mårtenson" <lokedhs@gmail.com>, "Eli Zaretskii" <eliz@gnu.org>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: call-process blocks the active thread
Date: Fri, 08 Sep 2017 11:27:29 +0000	[thread overview]
Message-ID: <CAArVCkQKyD-OEubNHvW7mC4X6JksoBeMRURFsDG=ZE1-D74AQA@mail.gmail.com> (raw)
In-Reply-To: <CADtN0WKoEv9oEd_q8JNC0_xk47p41m7Q_6kMF1i_cNXjekzBjQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

Elias Mårtenson <lokedhs@gmail.com> schrieb am Fr., 8. Sep. 2017 um
13:00 Uhr:

> On 8 September 2017 at 15:01, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> > From: Elias Mårtenson <lokedhs@gmail.com>
>> > 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.

[-- Attachment #2: Type: text/html, Size: 1799 bytes --]

  reply	other threads:[~2017-09-08 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08  3:00 call-process blocks the active thread Elias Mårtenson
2017-09-08  3:56 ` Eric Abrahamsen
2017-09-08  7:01 ` Eli Zaretskii
2017-09-08  7:45   ` Stefan Monnier
2017-09-08  8:06     ` Eli Zaretskii
2017-09-08 10:36   ` Elias Mårtenson
2017-09-08 11:27     ` Philipp Stephani [this message]
2017-09-08 12:16     ` Eli Zaretskii
2017-09-08 16:12       ` Tom Tromey
2017-09-08 18:43         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAArVCkQKyD-OEubNHvW7mC4X6JksoBeMRURFsDG=ZE1-D74AQA@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lokedhs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).