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: SIGPROF + SIGCHLD and igc Date: Tue, 31 Dec 2024 13:57:09 +0000 Message-ID: <87ttakneh3.fsf@protonmail.com> References: <87o713wwsi.fsf@telefonica.net> <87bjwvedzn.fsf@protonmail.com> <86ttanqc0p.fsf@gnu.org> <87bjwu2pb6.fsf@protonmail.com> <86pll9nrgz.fsf@gnu.org> <87seq5xgpt.fsf@protonmail.com> <86ikr1njuv.fsf@gnu.org> <875xn0rihm.fsf@protonmail.com> <86y0zwm3nh.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="21785"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, gerd.moellmann@gmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, acorallo@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 31 15:16:41 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 1tSd33-0005Wh-2l for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Dec 2024 15:16:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSd2K-00066t-EW; Tue, 31 Dec 2024 09:15:56 -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 1tSckJ-0003NA-W3 for emacs-devel@gnu.org; Tue, 31 Dec 2024 08:57:20 -0500 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSckH-0006GX-OY; Tue, 31 Dec 2024 08:57:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735653433; x=1735912633; bh=WJycopP8aYuklDFqbriMUNAK3ejPXnH/W6ZCO98wKo4=; 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=vUUjVrez6j08tJMpyNdZydKb9JmzE6ETj57Tg/RiWfr0I7RnbZd1CtjehMdWu/qYX UyS1I+KMFZdEefZDSQG8Wp0YiNuRcwBurSAlqvVWoRvfclrtqP1JDOoZeyW/O5+yM/ abgJtNH244+8mShWk/PrqKyg8/n55P21R7aWpKjcA8hhGNvpLEdRvblxJlUZdvpihN fevXPgWgMLlYEN24MCSiQxHo3HpvRw8VUhOLwp/DtPwAjjyzGUhFkNnPdkOBBjhO0i GoxXDNgC27MOzylKaEmbfI09l2LFIp076Y01l2XL10YeOwfe0hW1YJcT5e1rzy9+J1 m21yidwpiY04g== In-Reply-To: <86y0zwm3nh.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 822161f11ff6c5a310b8a26105052a5950c811c0 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.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_H3=0.001, RCVD_IN_MSPIKE_WL=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: Tue, 31 Dec 2024 09:15: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:327509 Archived-At: "Eli Zaretskii" writes: >> Date: Mon, 30 Dec 2024 21:04:34 +0000 >> From: Pip Cet >> Cc: eller.helmut@gmail.com, gerd.moellmann@gmail.com, ofv@wanadoo.es, em= acs-devel@gnu.org, acorallo@gnu.org >> >> "Eli Zaretskii" writes: >> >> >> Date: Mon, 30 Dec 2024 16:46:20 +0000 >> >> From: Pip Cet >> >> Cc: eller.helmut@gmail.com, gerd.moellmann@gmail.com, ofv@wanadoo.es,= emacs-devel@gnu.org, acorallo@gnu.org >> >> >> >> We can't avoid re-killing because we might be on another thread. >> > >> > If we are on another thread, we know that, and can delay running the >> > body. Or we could just run the body (all the signal handlers we have >> > that I know about don't care: MS-Windows already does that). So this >> > problem doesn't exist in practice, IME. >> >> Your (second) suggestion was to run the "signal handler" in parallel to >> the main thread > > Yes. > >> which continues to mutate Lisp data. > > No. The main thread continues to mutate Lisp data unless we stop it. Your proposal did not include that bit, which is hard to do on POSIX systems. But the rest of your email makes it sound like we agree we should improve the current code ((1) on my list), which handles signals on the main thread while it is suspended. Let's do that rather than arguing? >=C2=A0Doing that from a signal handler is a definite no-no, certainly > if we call the handler from a non-Lisp thread. The only signal > handler which currently does touch Lisp data, or comes close, is > SIGCHLD. The MS-Windows emulation of SIGCHLD runs the handler ??? SIGPROF looks at the specpdl? > And saving buffers generally must allocate memory. So it is not easy > to make this reliable enough, it needs very careful programming and > probably also some small reserve of memory ready to be used. We already have code to switch to malloc when IGC dies. Pip