unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Re: async Gnus
Date: Tue, 25 Jan 2022 09:29:22 -0800	[thread overview]
Message-ID: <87fspbzpu5.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87a6flqddp.fsf@elite.giraud

Manuel Giraud <manuel@ledu-giraud.fr> 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




  reply	other threads:[~2022-01-25 17:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 16:58 async Gnus Manuel Giraud
2022-01-25 17:29 ` Eric Abrahamsen [this message]
2022-01-26 10:05   ` Manuel Giraud
2022-01-26 13:10     ` Eli Zaretskii
2022-01-26 14:58       ` Manuel Giraud
2022-01-26 15:32         ` Thomas Fitzsimmons
2022-01-26 16:36           ` Manuel Giraud
2022-01-26 17:53             ` Eric Abrahamsen
2022-02-01 16:26               ` Manuel Giraud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fspbzpu5.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).