unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet via "Emacs development discussions." <emacs-devel@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: scratch/igc: Avoid MPS being interrupted by signals
Date: Wed, 08 Jan 2025 08:27:24 +0000	[thread overview]
Message-ID: <87ldvlg17a.fsf@protonmail.com> (raw)
In-Reply-To: <m2zfk2aqzc.fsf@gmail.com>

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> As I mentioned, I reverted
>
>   ceec5ace134 * Avoid MPS being interrupted by signals
>
> in my fork because I observed worse "smoothness" in interactive use on
> macOS.

Eli said Helmut was working on fixing this commit for SIGIO/SIGPOLL,
which is most likely the problem (and implied I shouldn't work on that,
of course, because Eli).  OTOH, if we just fix the few remaining
handlers, it's safe to remove it.

> Is this commit still strictly necessary on non-macOS now that

I don't understand why you think this differs between macOS and
non-macOS.  The way macOS handles SIGSEGV does not make things any
safer: if a signal handler accesses MPS data we lose on any platform.

That said, there aren't that many signal handlers.  Definitely SIGINT
(accesses terminal data), technically SIGUSR (accesses symbol, string,
string data), probably more on Windows and Android.

> Helmut's changes for SIGPROF are in?

Helmut's changes for SIGPROF and SIGCHLD were present before that
commit.  They make SIGPROF safe, but discard data when igc_busy_p (),
which has false positives.  I don't understand why SIGCHLD needs a
fixed-size queue and function pointers rather than simply setting a
flag, but what it does now is safe.

igc_busy_p () uses pthread_trylock, but that seems safe on glibc.

> If not, I'd like to reverse it on scratch/igc.

I don't know what you decided wrt scratch/igc and Eli.  If we really
want to spend more time on signal handling we can remove it and fix the
remaining handlers; if we don't, special-case safe signals and leave it
in.

Pip




  reply	other threads:[~2025-01-08  8:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  4:07 scratch/igc: Avoid MPS being interrupted by signals Gerd Möllmann
2025-01-08  8:27 ` Pip Cet via Emacs development discussions. [this message]
2025-01-08  9:34   ` Gerd Möllmann
2025-01-08 12:11     ` Pip Cet via Emacs development discussions.
2025-01-08 13:27     ` Eli Zaretskii
2025-01-08 14:08       ` Gerd Möllmann
2025-01-08 14:18         ` Eli Zaretskii
2025-01-08 14:46           ` Gerd Möllmann
2025-01-08 15:42             ` Eli Zaretskii
2025-01-08 17:30               ` Gerd Möllmann
2025-01-08 18:44                 ` Eli Zaretskii
2025-01-08  8:32 ` Pip Cet via Emacs development discussions.
2025-01-08  9:35   ` Gerd Möllmann
2025-01-08 12:07     ` Pip Cet via Emacs development discussions.

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=87ldvlg17a.fsf@protonmail.com \
    --to=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=pipcet@protonmail.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).