From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: igc, macOS avoiding signals Date: Mon, 30 Dec 2024 15:05:51 +0000 Message-ID: <87bjwtyzxn.fsf@protonmail.com> References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <878qrxoayj.fsf@gmail.com> <8734i5o6wc.fsf@gmail.com> <87cyh9mpn5.fsf@gmail.com> <86r05pnrv4.fsf@gnu.org> Reply-To: Pip Cet Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8886"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= , eller.helmut@gmail.com, spd@toadstyle.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 30 16:12:57 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tSHRx-00029I-J4 for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Dec 2024 16:12:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSHRO-00053f-W4; Mon, 30 Dec 2024 10:12:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSHLE-0002yG-Nf for emacs-devel@gnu.org; Mon, 30 Dec 2024 10:06:01 -0500 Original-Received: from mail-40131.protonmail.ch ([185.70.40.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSHLC-0007N4-Ha; Mon, 30 Dec 2024 10:06:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735571155; x=1735830355; bh=uicOvLxZJBFS9j76UjrGktntySAZgoy2TKDyTkXJBmg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=aoD5vdLz3UN0k+xgbacxzBdmLiZckCE58MQzZkcMcLGUMJps+eS+2AiFatelwVUCY 8jOwXPBPVdA+xhIZDNRzlnFTEXTADIKC4TiPfVZGZw7FiztIqab3fEqneUX7wGpqy0 sh6Gsx9c4Dl9sXcVuGYhfUP8uCrGM8s+lyOdNCuks1fcNBUELkIvTJAtHNJKgOwbtz 7RXX8ejRx6rfCOKO1to5yU/Vz/zUePGaDl/fYBMRiQmiGBdyLa8+fugX2/eDICv5e9 kz6A+f2d2U0lzGrfrOKx/6u5ue/oZwJY8LTsjFXp4kDj3xXMLP0vggkNP9ORiDCDH6 csenBRnoddgEA== In-Reply-To: <86r05pnrv4.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: f89794096e21b69ac2e462f43c54838ecb32f4af Received-SPF: pass client-ip=185.70.40.131; envelope-from=pipcet@protonmail.com; helo=mail-40131.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 30 Dec 2024 10:12:19 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327437 Archived-At: "Eli Zaretskii" writes: >> From: Gerd M=C3=B6llmann >> Cc: Eli Zaretskii , 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. My understanding is that the main thread cannot continue running while it's waiting for a memory barrier to be removed. What would it use for the memory values it cannot access? > Moreover, the main thread is not stopped, it runs the signal handler. It is stopped, in the signal handler, waiting for the memory barrier to be removed. Pip