emacs-devel
[Top][All Lists]
Advanced

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

Re: igc, macOS avoiding signals


From: Eli Zaretskii
Subject: Re: igc, macOS avoiding signals
Date: Mon, 30 Dec 2024 16:54:39 +0200

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  spd@toadstyle.org,
>   pipcet@protonmail.com,  emacs-devel@gnu.org
> Date: Mon, 30 Dec 2024 12:53:33 +0100
> 
> Executive summary: If a signal interrupts the Emacs thread, and we are
> "inside MPS", meaning the Emacs threads owns an arena's mutex, the macOS
> port thread can try to acquire the same mutex and won't get because the
> Emacs thread that owns it is stopped by the signal.

Are you sure the "because the Emacs thread that owns it is stopped by
the signal" part is correct?  AFAIU, since the macOS port thread is a
different thread, it tries to take the arena lock, and is simply stuck
there, waiting for the main thread to release the lock.  IOW, this is
a simple mutex-based synchronization between two threads, that's all:
one thread takes the lock, the other must wait until the first one
releases it before it itself can take the lock.

Moreover, the main thread is not stopped, it runs the signal handler.
Right?

Or what am I missing?



reply via email to

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