From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: igc, macOS avoiding signals Date: Mon, 30 Dec 2024 16:54:39 +0200 Message-ID: <86r05pnrv4.fsf@gnu.org> References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <86ed1rswup.fsf@gnu.org> <87h66loc17.fsf@gmail.com> <878qrxoayj.fsf@gmail.com> <8734i5o6wc.fsf@gmail.com> <87cyh9mpn5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22565"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, spd@toadstyle.org, pipcet@protonmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 30 15:55:03 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 1tSHAd-0005hk-GO for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Dec 2024 15:55:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSHAJ-0007MQ-TP; Mon, 30 Dec 2024 09:54:43 -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 1tSHAI-0007M7-Qa for emacs-devel@gnu.org; Mon, 30 Dec 2024 09:54:42 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSHAI-0005y3-0m; Mon, 30 Dec 2024 09:54:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=gpWz0kEu7Wvie7zsquhwBtvCb011OQcoM8okNNtcu/E=; b=cA8SvCRE6wu4hvxHB8OV Eq3ybBUPFLkl9oHHidyM0zzMI2pesT/9buO1DWp8JQabucqwI6rTV0RtFcecH/LslJ1KMvv45dQCG 0qhIz07tGWQGsp60P1tzhKOm3/qVaHfq/6a/2jkso4oQqVHhfsxIUlaapq9CFSTfjZUvmjgbssbat mWJbXVGPhfwkpFSFFGoYfemmduDJLfaXtlL5eFLL6vcqguLYiKqVP+DETkoATyoOEU+C9vgK562RM P0ATM1yAt7P7+5GYFCoAtwtDsUw1nw9H5RzeTSPqm8rS7Rb+A2EUALGWf9aSnBZKFRSDwHIGqDdd2 L/1xcYed0M0QvA==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Mon, 30 Dec 2024 12:53:33 +0100) 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:327433 Archived-At: > From: Gerd Möllmann > 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. Moreover, the main thread is not stopped, it runs the signal handler. Right? Or what am I missing?