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: Thu, 10 Feb 2022 10:25:52 -0800 Message-ID: <87a6eya89b.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37361"; 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 Thu Feb 10 19:32:04 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 1nIEEe-0009Ul-PE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 19:32:04 +0100 Original-Received: from localhost ([::1]:49548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIEEd-0000YJ-OC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 13:32:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIE9r-0005J6-Bg for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 13:27:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIE9m-000519-Lo for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 13:27:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIE9m-0005P9-HC for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 13:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Feb 2022 18:27:02 +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.164451756420684 (code B ref 53877); Thu, 10 Feb 2022 18:27:02 +0000 Original-Received: (at 53877) by debbugs.gnu.org; 10 Feb 2022 18:26:04 +0000 Original-Received: from localhost ([127.0.0.1]:57109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIE8q-0005NX-5q for submit@debbugs.gnu.org; Thu, 10 Feb 2022 13:26:04 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:46232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIE8n-0005Mw-8T for 53877@debbugs.gnu.org; Thu, 10 Feb 2022 13:26:02 -0500 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 76C24FA08F; Thu, 10 Feb 2022 18:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1644517554; bh=2I163G3qHCeleaMC0t4zGz4+wX1uespfTv+3UWvlgLQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=yGoDjcvYMR9UQ3UDyZALXY/tnZegt7yT78yOErS2hKNV2Heio7wI9JMFR8AtX4w09 vexzRYxiummgltcjkLHIEFckCBNqyig4aEso3pEvSXtWWTtKdmlwqX7oJoS7xGl/Du w5gO2XBJRaJOxSBqASj15rQfpGQsgjF0uOmSWsQg= In-Reply-To: <87iltma8wj.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 10 Feb 2022 10:11:56 -0800") 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:226620 Archived-At: On 02/10/22 10:11 AM, Eric Abrahamsen wrote: > On 02/10/22 10:02 AM, Manuel Giraud wrote: >> Eric Abrahamsen writes: >> >>> Manuel Giraud writes: >>> >>>> Lars Ingebrigtsen writes: >>>> >>>>> Why can't you bind `nnmail-article-buffer' before calling the splitting >>>>> function? >>>> >>>> I spoke too quickly. The idea was that with a temporay buffer I could >>>> run multiple splitting in "parallel". But rebinding just *one* global >>>> variable won't help much here. >>> >>> Are you sure? AFAIK this was Dick Chiang's approach to threading >>> server updates: let-binding the value of `nntp-server-buffer' within >>> the thread function. As far as I know it worked okay. The splitting >>> function and code run within it will have a separate value of >>> `nnmail-article-buffer'. >> >> I'm trying another approach: seek to the processes in the backend, don't >> wait for them to end but instead attach sentinels for what's left to >> do. Maybe it is not the best approach because Gnus seems to be heavily >> stateful/serial. >> >> I'm not sure about binding in sentinels: do you think it would work as >> binding in threads? > > 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: > > (defun test-threads-outer () > (dolist (label (list "one" "two" "three")) > (make-thread (lambda () (test-threads-inner label)) label))) > > (defun test-threads-inner (label) > (let ((nnmail-article-buffer (format "nnmail-incoming-%s" label))) > (with-current-buffer (get-buffer-create nnmail-article-buffer) > (insert label)))) > > That creates three separate buffers, named correctly, and holding the > correct text. Though in this simple example, the copies of the inner function are actually still being executed consecutively, so maybe this doesn't prove anything? I don't have much faith in my reasoning about threads.