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: SIGPROF + SIGCHLD and igc Date: Tue, 24 Dec 2024 14:54:19 +0200 Message-ID: <86h66t2qdg.fsf@gnu.org> References: <87o713wwsi.fsf@telefonica.net> <87ldw7fwet.fsf@protonmail.com> <87a5cnfj8t.fsf@protonmail.com> <86seqe4j4f.fsf@gnu.org> <87ttaucub8.fsf@protonmail.com> <87pllicrpi.fsf@protonmail.com> <864j2u442i.fsf@gnu.org> 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="22539"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pipcet@protonmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@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 24 13:54: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 1tQ4R7-0005ho-C7 for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 13:54:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ4Qh-0003Y4-9O; Tue, 24 Dec 2024 07:54:31 -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 1tQ4Qa-0003Xi-6S for emacs-devel@gnu.org; Tue, 24 Dec 2024 07:54:24 -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 1tQ4QZ-00013T-7D; Tue, 24 Dec 2024 07:54:23 -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=4NL/KBvZDDYEAsngAj8UwGkeeSAgA0EmhNpfeXGSDms=; b=r41KnPtpoI8GBY18KyvV sk6kWmKlfADqu65LafSOVl0ihzyPaQyCIOFJ74jLLWAJsYLwlI5XGo0ZWaI1awqn4GVRnxX0ccC4C GDr+z0jKDtzEKC/HGyyui8MBLwvokxzgclw2XrxKrSwLa7cm1oMi6fY9i9jQYMUajLrzngASTajom mNWRj+cjBNwFUTEw9NzXv3stxIfyvJmOySljJvmmszOKP/QOnKIj0sg3mafJca+naFss5inZy2iij whqKmdyKXNymxi693uY7eI2F+JuiC7kuo67VAZQN9qFH0372o5IeOmlTwVqJ3pwLeM/3mo/Y25Mgm 3qajYSILwydUOw==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Tue, 24 Dec 2024 07:03:53 +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:327000 Archived-At: > From: Gerd Möllmann > Cc: pipcet@protonmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, > eller.helmut@gmail.com, acorallo@gnu.org > Date: Tue, 24 Dec 2024 07:03:53 +0100 > > (I've given this a new subject.) Not a second too soon! > This is about SIGCHLD, and I must say I find it a bit hard to tell if > all other platforms do the same. There are simply too many #if's to > consider in the signal handling code. > > Anyway, what I see here: SIGCHLD doesn't do anything dangerous in the > signal handler. Instead, the occurrence of SIGCHLD is added to a queue > with enqueue_async_work and that's basically it. Are we looking at the same code? I was talking about handle_child_signal, which is called thusly: static void deliver_child_signal (int sig) { deliver_process_signal (sig, handle_child_signal); } What I see in handle_child_signal is not what you describe above. > The work items in the queue are processed by process_pending_signals, > outside of the signal handler. Very nice, that's how it should be :-). I think you are looking at how SIGIO and SIGALRM are processed. > (And maybe, just as an inspiration, one could use that construct for > SIGPROF?) Could one? SIGPROF's handler should sample the "program counter", so delaying the sample will sample it in a wrong place. Right?