From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: Releasing the thread global_lock from the module API Date: Fri, 1 Mar 2024 20:30:11 +0100 Message-ID: References: <86cysdrja3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kdWEz/o2urPsgzyz" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37980"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 01 20:31:02 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 1rg8b0-0009fR-C2 for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Mar 2024 20:31:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg8aR-0006G1-MT; Fri, 01 Mar 2024 14:30:27 -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 1rg8aH-0006FL-J4 for emacs-devel@gnu.org; Fri, 01 Mar 2024 14:30:20 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rg8aF-0001uc-2H for emacs-devel@gnu.org; Fri, 01 Mar 2024 14:30:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ZdM3ef5/6d0YiRiezt5x8b7D0Bbi0QEhMYtlyRBh1rI=; b=NBKXdOhGPLdpcS+vlb5HJNr9ni ceElQoVELG5Tm0fn2GqJDGk93OGPqYgVsVkGD8vj6/IbfpZFlIFgDCljjZBYLQM1GjTKno4BQdCnM gvdIfHNnOCbua4fW+LifDU5TShecfYgnajN12bDFCHgn2PzG7UETHbnQOl65cG54IktxHs4EnlJQ2 wmUa19DT3m9yC+MU+qM1iaFbxLM6Kt0yXikEYdk1FP/7rN0OMPGeNSDytJjwpzIwJX1c7NYOdreMg 0+hw8EYrLcucrbTH/MxO31Yo4SqJIl6yYEMd76AIBfSDo6fUqy2CXrPYww6gJPPFQzYaRU3v01HCa MnNcvU7A==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1rg8aB-0000Mj-Ej; Fri, 01 Mar 2024 20:30:11 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:316677 Archived-At: --kdWEz/o2urPsgzyz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 01, 2024 at 12:34:36PM -0500, Spencer Baugh wrote: [...] > We can't do: > - Lisp thread A calls module_work > - On thread A, module_work releases the global lock. > - On thread A, module_work starts native threads X and Y, > and does Emacs-independent work across all of these threads in parallel. If X and Y are truly independent of the Lisp machinery, I don't understand what keeps you from sending both their ways and terminating thread A, thus setting Lisp free for whatever other thread wants to take over. > - Unrelated Lisp thread B is able to take the global lock and run Lisp co= de > in parallel with module_work on thread A. > - On thread A, module_work finishes and returns to Lisp. Why has thread A wait up to here? This is what's keeping your thread B =66rom playing, no? Cheers --=20 t --kdWEz/o2urPsgzyz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZeIsvAAKCRAFyCz1etHa RjmpAJ0fBTDl8oqL4tIp0YFDB0CdDGN/JwCcCdviIbRk3aEcs5AAmXmhEpsHiXA= =8D7K -----END PGP SIGNATURE----- --kdWEz/o2urPsgzyz--