From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#53877: 29.0.50; [PATCH] async Gnus/nnml Date: Fri, 11 Feb 2022 09:53:12 -0800 Message-ID: <87bkzd8f3r.fsf@ericabrahamsen.net> References: <87leyl1lr9.fsf@elite.giraud> <87bkzgpi9u.fsf@gnus.org> <87tud8cr5q.fsf@elite.giraud> <878rukmkpf.fsf@gnus.org> <87k0e4cojb.fsf@elite.giraud> <87v8xol3tr.fsf@gnus.org> <877da4cjdg.fsf@elite.giraud> <87o83gq9q5.fsf@ericabrahamsen.net> <87o83faybg.fsf@elite.giraud> <87iltma8wj.fsf@ericabrahamsen.net> <87sfspacwi.fsf@elite.giraud> 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="16417"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53877@debbugs.gnu.org, Lars Ingebrigtsen To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 11 18:54:09 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nIa7V-000449-B7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Feb 2022 18:54:09 +0100 Original-Received: from localhost ([::1]:53004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIa7U-00025b-56 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Feb 2022 12:54:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIa7O-00025E-0P for bug-gnu-emacs@gnu.org; Fri, 11 Feb 2022 12:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIa7N-00064B-NP for bug-gnu-emacs@gnu.org; Fri, 11 Feb 2022 12:54:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIa7N-0004J5-NK for bug-gnu-emacs@gnu.org; Fri, 11 Feb 2022 12:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Feb 2022 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53877 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53877-submit@debbugs.gnu.org id=B53877.164460200316504 (code B ref 53877); Fri, 11 Feb 2022 17:54:01 +0000 Original-Received: (at 53877) by debbugs.gnu.org; 11 Feb 2022 17:53:23 +0000 Original-Received: from localhost ([127.0.0.1]:60919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIa6k-0004I8-KB for submit@debbugs.gnu.org; Fri, 11 Feb 2022 12:53:22 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:46790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIa6j-0004Hv-8G for 53877@debbugs.gnu.org; Fri, 11 Feb 2022 12:53:21 -0500 Original-Received: from localhost (97-126-64-167.tukw.qwest.net [97.126.64.167]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 81244FFD93; Fri, 11 Feb 2022 17:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1644601994; bh=rNPgJ6C8fxhghxNUc/uIL/UtXlzKCNN28f8FjxYST3I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=yv5DqbBLhvWSVx/RuMc6uzSmZ1NEyT3h1P8dnTo5NQjxw/+iOCvct1fVZGaYYh7Qc /2cCOWok0gk5SLAF4A106S5DyWgjcsMQLKmXKyrhgD1UmUaE1c1XEdTLoI0eDVIQQF vZ74RUmwe4Pp4agEboYgbuRvUn0jsspYja/Uh0t8= In-Reply-To: <87sfspacwi.fsf@elite.giraud> (Manuel Giraud's message of "Fri, 11 Feb 2022 11:57:49 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226674 Archived-At: Manuel Giraud writes: > Eric Abrahamsen writes: > > [...] > >> Are you sure the original approach won't work? If you set >> `nnmail-article-buffer' locally within the thread function, it seems to >> work okay. Is this not workable: > > Hi Eric, > > I was trying just something different. The process/sentinel seems like a > good (established) way to do this in emacs without having to rely on > handling threads yielding (when?). Maybe it won't be fruitful though =F0= =9F=98=85 Without having actually gone and written the code myself... my guess is these two approaches will end up being pretty equivalent in design, only the details will vary. You're going to launch several "things" in a loop (the things being either threads, or processes+sentinels), then block the rest of Emacs while you wait for all of the "things" to be done, then carry on with main function execution. Gnus is not set up for these "things" to return at random intervals, ie we cannot "fire and forget". Not to mention that the "things" will block Emacs while running elisp, but relinquish control while receiving process output, which I think would lead to a kind of "stuttering" responsiveness that would be more annoying than simply blocking Emacs altogether. No matter which approach you take it will probably have to wait for all the things to return before it continues, so the only advantage is in being able to "layer" multiple process io and save a little time there. The Trio python library has a neat concept called nurseries, which guarantees that multiple child threads all have to return before main code execution continues, that might be interesting to look at: https://trio.readthedocs.io/en/latest/reference-core.html#nurseries-and-spa= wning