unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: emacs-devel@gnu.org
Subject: Re: block_input for some APIs
Date: Tue, 13 Dec 2016 09:13:40 +0900	[thread overview]
Message-ID: <wl1sxc65zf.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <jwv1sxcrfcj.fsf-monnier+gmane.emacs.devel@gnu.org>

>>>>> On Mon, 12 Dec 2016 16:48:53 -0500, Stefan Monnier <monnier@iro.umontreal.ca> said:

>>> Does anyone remember why we block input around calls to functions like
>>> getpwnam or tzset or fwrite?
>> I think this dates back to when C-g and/or other handlers called
>> longjmp.

> I'm not completely sure, but my own impression is that this dates back
> to before SYNC_INPUT, i.e. with input became available, we'd get an IO
> signal and in the handler we'd run a whole bunch of code, since
> reentrance was a big issue.  Nowadays we delay this async processing to
> the next QUIT so there's no re-entrance issue any more.

I added some of them around early 2007, when SYNC_INPUT was not used
by default.  These functions call malloc etc. internally (at least on
Darwin), so it was not safe to call read_socket_hook, which also calls
malloc etc., from SIGIO/SIGALRM handler while processing getpwnam etc.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp



  parent reply	other threads:[~2016-12-13  0:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12 18:01 block_input for some APIs Eli Zaretskii
2016-12-12 21:08 ` Paul Eggert
2016-12-12 21:48   ` Stefan Monnier
2016-12-12 21:53     ` Daniel Colascione
2016-12-13  3:46       ` Eli Zaretskii
2016-12-13  0:13     ` YAMAMOTO Mitsuharu [this message]
2016-12-13  3:43   ` 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

  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=wl1sxc65zf.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=emacs-devel@gnu.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 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).