From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: SIGPROF + SIGCHLD and igc Date: Sun, 29 Dec 2024 19:50:09 +0100 Message-ID: <87msgeb9y6.fsf@gmail.com> 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> <87a5ch5z1b.fsf@gmail.com> <86y101wlsr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37740"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: gerd.moellmann@gmail.com, pipcet@protonmail.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 Sun Dec 29 19:50:55 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 1tRyNL-0009jr-1L for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Dec 2024 19:50:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRyMm-0000Ye-4j; Sun, 29 Dec 2024 13:50:20 -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 1tRyMj-0000YT-QF for emacs-devel@gnu.org; Sun, 29 Dec 2024 13:50:18 -0500 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRyMh-0006Z5-E0; Sun, 29 Dec 2024 13:50:17 -0500 Original-Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aa68b513abcso1636066666b.0; Sun, 29 Dec 2024 10:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735498211; x=1736103011; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZQ/OFA4dHR5uhLAupJNTOIA6yNfiH1dXDF64jRfFBAE=; b=LkArarFxQEBEreiSkmavOVUC14O3mVXLlecQtYJWv03EcUoNiAb7QBXSheVXXuYU4U Npb3HJvBpYelZuB1m2xdmFZsgXLelBBysKBtngToETgg4NTTth4pXGlsVAXrLgl17MEU MUDcQW9LGe1AkM4n99pgOp4DvASZr5gj9pfLSETH5xmYgG+F3Rg8J7372grW+81PYgBL aUGVnEZl/6rd5XOJyMdiA2kK1dXmFbqbPPyUf/iDhiuE7XUg8lCPrICA2r0CR1BzWMF6 2xj3avuN08U6ryXVmoDhGdn8qWAjLZnxIOTj2xypszgb+GPNaFeBfqvenu16/eXTgJi1 pqcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735498211; x=1736103011; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZQ/OFA4dHR5uhLAupJNTOIA6yNfiH1dXDF64jRfFBAE=; b=i0Ld3hRDKgVvQf7oGxf5EbSqNUnAshuanjkGHZr0FKoK/GBx0DKafL6cxpx5dsoFaC JI7YahR59g1dHSluHTXRKnUaJ85f6YaKeFlI2bzBQPPBUJrUkWEt9w6tN04mvd+IFcTo vBJOEpmt+bTGLCdtQKxOqpQ5/r+YInw0c/eoJbfWJXXKZs5+KPLxEyYTS1LbEoWF8o0u Vm+Xla2QSMcg1xliKxYuz6W55vFKhmvV127yiFITlj6rjUR4u9yyxjWrcr51/Mj35UlE iEK8HtOp9IU8zUHqEWzY1+sbP/e426ku8GPuXYhAXR1A8W/xiDeZAaZdAc4mikorHJEW npYA== X-Forwarded-Encrypted: i=1; AJvYcCU5u5JuCywuAK3OH+l5esJVRJ2BE2tvpep/TuWJsiCx/bEPdI7Phcg42yZmeU9aLaCikviRrHPsFaw5eIU=@gnu.org, AJvYcCVvx9IdoT8cLliiMNXz9ZsW39Vpa38wQOvuyJFTf/dEWd+Fmc7cz7G+EF3MKtv52U6NcIArKzaang==@gnu.org X-Gm-Message-State: AOJu0YwZ7KIVKJ96uNq4aI4HAri1OJiWwJm0+IvJr+ncqUIKFboZOiPG uhz/6mLAES3AWEF9sfHavOG8dTC703NifzsCnAGZ9kpVWiU1meLPM2bDx2nt X-Gm-Gg: ASbGnctTSPWvpo0tqqF4bG/qFhFkf/l06CVWLXZ/2e6kPTUpAANyv0DmHmdHDYDKYL7 Q0dyrhqrfvSlrDIXyRBkUCMihCFbO7U0CpYwNsu3s43rjBPOsWP2WFZY0TaTy9wurPZ1B+FC1Sy BJ91OPP8QsZToqdwopWLAxkJViHrlBD+TzoENdn2c+Kh4Z2MRxK9VVikTB4hDhek6dd7PMNobfR G94bW2BZlnwjmF7rDX8xBqq0eJ4qBkcalDUBe3LO5EPLLUaREN0U4g= X-Google-Smtp-Source: AGHT+IHaB7+9bL1tyZm0x9l13GLOLZdPCymBpzXMjFp0soPTWXzPAPj7rvydsBU4WuYemdwQrsGEAg== X-Received: by 2002:a17:907:3d86:b0:aa6:9eac:4b7e with SMTP id a640c23a62f3a-aac2d455458mr3450624266b.30.1735498210979; Sun, 29 Dec 2024 10:50:10 -0800 (PST) Original-Received: from caladan ([31.177.115.143]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0efe4988sm1400145766b.124.2024.12.29.10.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Dec 2024 10:50:10 -0800 (PST) In-Reply-To: <86y101wlsr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Dec 2024 10:51:48 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x631.google.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:327358 Archived-At: On Fri, Dec 27 2024, Eli Zaretskii wrote: [...] > You are basically describing the way SIGPROF emulation is implemented > on Windows (see w32proc.c for the details). But I don't understand > why you need that pipe: doesn't pthreads allow one thread to stop the > other? If so, just make the "profiler thread" stop the main thread > instead of your step 2, and resume the main thread instead of your > step 4. Am I missing something? Here another observation: Let's assume that we can emulate SuspendThread and ResumeThread on POSIX and MacOS (much like MPS does it). In the profiler thread we can then simply do: SuspendThread () get_backtrace () ResumeThread () without invoking any SIGPROF handler or the need for ArenaEnter/ArenaLeave. The only complication seems to be, that we must avoid deadlocks when MPS tries to suspend a thread is already suspended by our emulation. Helmut