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: Some experience with the igc branch Date: Tue, 24 Dec 2024 15:46:07 +0200 Message-ID: <867c7p2nz4.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> <87ldw6as5f.fsf@protonmail.com> <86o7112rnq.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="22204"; 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 14:46:33 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 1tQ5F3-0005f9-9N for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 14:46:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ5Em-0003oQ-82; Tue, 24 Dec 2024 08:46:16 -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 1tQ5Ei-0003nQ-3i for emacs-devel@gnu.org; Tue, 24 Dec 2024 08:46:12 -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 1tQ5Eg-0000br-PA; Tue, 24 Dec 2024 08:46:10 -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=IGtQQQ5Ec7nxMOfb2a0yuhli+afoZNyi7IeGkmAMOrI=; b=ZZrorEtMxvdk5p1dTg2h MDSCuDGZRPgWrbM3ABQEoAOjF5zUfAMXZDgxe1ngWkOsB0HsIsz2GSv2rSJQrHoZnAAqVBH156vZD bDN+EWw9Gk60/9lCkw83OOQhse617XEJVkZepCLG/k3fcwKCmMoj4eF8U8hOvpl2lZJ31H3R4OMPc oflFPakH83JZlplEzJ/qVfjq9pC+bqaDIKQA3pbEtertmR+G15yJRbc7fRMxkpnqh1e0sWFYv12gr O3KEk+AqtqET/96reU8bXL/OATQ1d3GtMIjo631Hi0XBQtW/ptAT1cjhQcUXbmDIOMOODDI3Fb9FQ +KQ1jcVKSNdLyg==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Tue, 24 Dec 2024 13:56:18 +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:327012 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 13:56:18 +0100 > > Eli Zaretskii writes: > > >> From: Gerd Möllmann > >> Cc: Eli Zaretskii , ofv@wanadoo.es, emacs-devel@gnu.org, > >> eller.helmut@gmail.com, acorallo@gnu.org > >> Date: Tue, 24 Dec 2024 05:03:36 +0100 > >> > >> I'd prefer to send messages from handle_profiler_signal. Or something > >> equivalent to sending messages. > > > > How would that be different? If the messages arrive asynchronously > > and are handled asynchronously, that's the moral equivalent of > > signals, no? > > I'm using SIGPROF below to make it more concrete. Similar for other > signals. > > The idea is to get the backtrace in the SIGPROF handler, without > accessing Lisp data. That can be done, as I've tried to show. > Then place that backtrace somewhere. Let's be more accurate: when I said "Lisp data", I actually meant any data that is part of the Lisp machine's global state. That's because you cannot safely access that state while the Lisp machine runs (and modifies the state). You need the Lisp machine stopped in its tracks. Agreed? Now, with that definition, isn't specpdl stack part of "Lisp data"? If so, and if we can safely access it from a signal handler, why do we need to move it aside at all? And how would the "message handler" be different in that aspect from a signal hanlder? > In an an actor model architecture, one would use a message that contains > the backtrace and post it to a message board. I used that architecture > just as an example, because I like it a lot. In the same architecture, > typically a scheduler thread would then assign a thread to handle the > message. The handler handling the profiler message would then do what > record_backtrace today does after get_backtrace, i.e. count same > backtraces. What is the purpose of delaying the part of record_backtrace after get_backtrace to later? Is the counting it does dangerous when done from a signal handler? > That's only one example architectures, of course. One can use something > else, like queues that are handled by another thread, one doesn't need a > scheduler thread, and so on, and so on. Pip's work queue is an > example. Doing this from another thread raises the problem I describe above: we need the Lisp thread(s) stopped, because you cannot examine the data of the Lisp machine while the machine is running. And if we stop the Lisp threads, why do we need the other thread at all? I guess we are tossing ideas without sufficient detail, so each one understands something different from each idea (since we have different backgrounds and experiences). My suggestion is that to describe each idea in enough detail to make the design and its implications clear to all. A kind of DR, if you want. Then we will be on the same page, and can have an effective discussion of the various ideas.