From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: 18420@debbugs.gnu.org
Subject: bug#18420: 24.3; interaction with external process hangs emacs
Date: Tue, 09 Sep 2014 17:26:45 +0300 [thread overview]
Message-ID: <837g1cc1ju.fsf@gnu.org> (raw)
In-Reply-To: <8538c1zasg.fsf@stephe-leake.org>
> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Cc: 18420@debbugs.gnu.org
> Date: Mon, 08 Sep 2014 23:18:39 -0500
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Did you try replacing accept-process-output with sit-for?
>
> The current code has:
>
> (accept-process-output process 0.1)
>
> This waits up to 0.1 seconds for output from the child process
> ada_mode_wisi_parse (or any other process, but there are none in this
> setup). In practice in this scenario, it returns much sooner than 0.1
> seconds; there is some output very quickly after sending any part of
> the buffer contents.
>
> Replaced with:
>
> (sit-for 0.1)
>
> This performs redisplay, then waits for SECONDS seconds or until "input"
> is available. The wait is done with 'read-event', which reads from "the
> input stream". So apparently this means user input, not child process
> input.
No, sit-for also reads from subprocesses, because it calls 'pselect',
which listens to subprocesses as well. What's more important, it
acknowledges the "read ready" signal sent by the reader thread, and
releases it from its wait.
> > How about enlarging the 2nd argument to accept-process-output -- did
> > you try that, and if so, did it have any effect?
>
> tried:
>
> (accept-process-output 1.0)
>
> This hangs.
It didn't hang for me in the simple program I just posted. Not sure
why the difference, but it isn't worth our time to figure that out,
since the solution is at hand.
> It doesn't change the child process behavior. I was hoping it would
> change the emacs side, allowing it to at least check for C-g every 0.1
> seconds. Hmm, I'm not clear that accept-process-input checks for input
> events.
What do you need by "input events"? Whenever 'pselect' is called, on
Windows it monitors the C-g keypresses as well (grep for
"interrupt_handle" in the sources).
> > Can you tell how much did it write to the pipe at that point?
>
> No, that info is not tracked in the current code. I can add it.
>
> The parser has read 2935 bytes.
If reading that much could cause it to write more than 4KB of output,
then it will block, and won't read more until Emacs reads its end of
the pipe.
> MinGW: not sure what this means; the runtime is just a bunch of
> packages.
The version is in the header _mingw.h.
> mingw-w64-i686-headers-git 4.0.0.4210.0177153-1
The version of the w32api is in w32api.h.
next prev parent reply other threads:[~2014-09-09 14:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 8:04 bug#18420: 24.3; interaction with external process hangs emacs stephen_leake
2014-09-07 15:38 ` Eli Zaretskii
2014-09-09 4:18 ` Stephen Leake
2014-09-09 14:26 ` Eli Zaretskii [this message]
2014-09-09 21:54 ` Stephen Leake
2014-09-08 17:00 ` Stephen Leake
2014-09-09 3:10 ` Stephen Leake
2014-09-09 14:17 ` Eli Zaretskii
2014-09-09 21:48 ` Stephen Leake
2014-09-14 15:20 ` Eli Zaretskii
2014-09-09 14:30 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=837g1cc1ju.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=18420@debbugs.gnu.org \
--cc=stephen_leake@stephe-leake.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.