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.devel Subject: Re: async Gnus Date: Tue, 25 Jan 2022 09:29:22 -0800 Message-ID: <87fspbzpu5.fsf@ericabrahamsen.net> References: <87a6flqddp.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6863"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:ZAgvhIdKynVJOx78uV0r58AliIU= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 25 18:32:59 2022 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 1nCPgh-0001X2-Kv for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Jan 2022 18:32:59 +0100 Original-Received: from localhost ([::1]:48582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCPgg-00023S-H2 for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Jan 2022 12:32:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCPdT-0008Ia-Sx for emacs-devel@gnu.org; Tue, 25 Jan 2022 12:29:40 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:45592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCPdS-0007nn-3s for emacs-devel@gnu.org; Tue, 25 Jan 2022 12:29:39 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nCPdM-0007h7-7r for emacs-devel@gnu.org; Tue, 25 Jan 2022 18:29:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" Xref: news.gmane.io gmane.emacs.devel:285376 Archived-At: Manuel Giraud writes: > Hi, > > I'd like to have Gnus being able to fetch some mails (and news > obviously ;-) without freezing emacs completely. I'm currently > trying the attached dumb patch that so far seems to fly with a gnus > demon handler like this: > > (gnus-demon-add-handler 'gnus-group-get-new-news 5 nil) > > My questions are: > > - Is this the right place to discuss Gnus dev? Yes! > - This patch seems too simple: what am I missing? It's hard to say -- no one seems to know what to expect with threads. The main issue I can see with your code is that it only uses a single thread, which should mean (I haven't tested it) that it provides very little speedup. All elisp execution happens in the main thread, the only concurrency happens with network and process communication (maybe some other stuff), so unless you're "layering" multiple process calls in multiple threads, everything's going to happen more or less consecutively anyway. I think you'd need one thread per Gnus server, so that multiple connections to external servers (IMAP or NNTP or POP) could do their thing concurrently. All this is just my theoretical understanding of how threads work, mind you. Have you seen a significant speedup with this patch? Also, bug#49065 might have some relevant code you could refer to, I think the author was trying to do something similar there. Thanks, Eric