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: Tue, 31 Dec 2024 15:18:21 +0200 Message-ID: <86msgcm1nm.fsf@gnu.org> References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <87h66loc17.fsf@gmail.com> <878qrxoayj.fsf@gmail.com> <8734i5o6wc.fsf@gmail.com> <87cyh9mpn5.fsf@gmail.com> <874j2l1hei.fsf@protonmail.com> <874j2lmd37.fsf@gmail.com> <87msgdkt29.fsf@gmail.com> <86h66lnjrt.fsf@gnu.org> <868qrxnfrw.fsf@gnu.org> <87a5ccl2zx.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="18177"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, pipcet@protonmail.com, spd@toadstyle.org, 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 Tue Dec 31 14:19:08 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 1tSc9L-0004ZD-Ma for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Dec 2024 14:19:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSc90-0004o9-Gi; Tue, 31 Dec 2024 08:18:46 -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 1tSc8y-0004nu-Md for emacs-devel@gnu.org; Tue, 31 Dec 2024 08:18:44 -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 1tSc8y-00083T-9V; Tue, 31 Dec 2024 08:18:44 -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=xKtQp/NkSfqzOSVIvxcsUVHFr+XshxXwGVJyB/CpGs4=; b=k87hyXfgdB5bwbRV+pfM 6m2QzCSuaBqG7gB+R/ICsHrm9UZw1l+XsUl+JLxsxIJgF3Q/U1+xb5oFn5sh229bffvI2XxEZK32U MfNuAVf9G/aoWX9XieQp2gMGwLwKnIrvBCdgGMKb3wzJvxhuwv0PqVBtTx8SxS9d2tWjdkYsBi86v QjytfSkCSvcwaoGeSfybjwM0xZGJ/IVCz9cUaI2iU8FTueuQgPFa/WIuox8MQhQxuLzWk2m1UdY/r 9P+j9wfjRcRW4z85WrjBuiRYeVK6YqKLDxM3szuKVjKU1zMvUmYJJYpzQm6MW7y2QWgaDuBJo8fmH x2tXIW3Pth5wWQ==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Tue, 31 Dec 2024 10:19:15 +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:327500 Archived-At: > From: Gerd Möllmann > Cc: Eli Zaretskii , pipcet@protonmail.com, > spd@toadstyle.org, emacs-devel@gnu.org > Date: Tue, 31 Dec 2024 10:19:15 +0100 > > Helmut Eller writes: > > > Except the POSIX police: it says that pthread_mutex_trylock isn't async > > signal safe. I suppose this also makes it's unsafe to use MPS's fault > > handler in an async signal handler. Bummer. (Does the police take > > bribes?) > > Thanks. I guess it shows that I couldn't keep up with my mail, sorry for > that. > > So we have this picture, I think > > t1 t2 t3 > ------------|------------|---------------------|-----------------> t > signal pthread other stuff signal handler > handler trylock until return to branching > calling signal handler on result of busy > mps_arena_ > busy > > We have a window [t1, t2] where the nested signals lead to undefined > behavior. and [t2, t3] where threads and nested signals can come into > play, but that's not a problem, iff signal handlers don't leave a lock > behind them. If the problem is other signals in [t1, t2], we could install the signal handler in a way that masks all other signals while the handler runs.