Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: is there a possibility for gnus to download data without blocking?
Date: Fri, 21 Aug 2020 10:16:08 -0700	[thread overview]
Message-ID: <875z9bvs13.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <868se8gjzj.fsf@protonmail.com>

Wayne Harris <wharris1@protonmail.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Wayne Harris <wharris1@protonmail.com> writes:
>>
>>> Is there a possibility for gnus to download data without blocking?
>>> Wouldn't it be nice to be able to keep using EMACS while Gnus is
>>> downloading?
>>>
>>> Is it a limitation of EMACS itself?  If so, is there any plans for
>>> supporting such things in the future?  Wouldn't it be nice?
>>
>> It would be lovely! There are a few issues: Emacs is single-threaded,
>> though it has the ability to continue execution while waiting on IO from
>> an external process. So theoretically we can already "download data
>> without blocking". In fact, Gnus already does this in a limited way:
>> when you hit "g", it starts an async external process for each of your
>> servers (each that involves an external process, anyway), then polls
>> each one until they're all done, and then continues with updating its
>> state.
>
> The fact that it uses external processes seems totally acceptable and
> perhaps even desirable.  I like external processes.  That means I could
> look at that part of the system individually using my shell.
>
>> That means there's really only a benefit when you have multiple servers
>> that can overlap their IO, and you're still going to wait as long as the
>> longest server takes.
>
> Interesting.  I haven't noticed that.  For example, when I say ``A A''
> on the group buffer to fetch a list of all groups, I see each news
> server being read one after the other.  But you didn't say this should
> have happened.  You said when I say ``g'' and I can't really tell what
> happens when I say ``g'', so I'll believe you.

Huh, I have never in my life used "A A". I just tried it, and indeed the
connections are made synchronously/consecutively. That's not a surprise,
because "g" (gnus-group-get-new-news) goes to quite a lot of trouble to
make the connections asynchronous, and that work isn't done elsewhere in
the code.

>> In theory we could have a Gnus that fires off all the servers and then
>> returns control to the user immediately, but that would involve handling
>> out-of-band returns as they came in from the servers, and Gnus would
>> have to be structured very differently than it is now to manage that.
>
> I don't expect ever to be able to download a bunch of data and have it
> all very fast on my screen.  But I do think that a system being always
> faster than the user gives the user an impression of total control,
> which is pleasurable.  So I would consider that a very nice improvement
> for Gnus itself.

The main issue is: if you get control of Emacs back right away, what
happens when the server response comes in? Work still needs to be done
to parse the response and incorporate it into Gnus' state, and that work
needs to be done in lisp, which means the user is probably going to get
interrupted again, to some extent. Let's see how Dick is handling it! :)



  reply	other threads:[~2020-08-21 17:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  4:06 Wayne Harris
2020-08-21  4:39 ` Eric Abrahamsen
2020-08-21 10:31   ` dick.r.chiang
2020-08-21 17:42     ` Eric Abrahamsen
2020-08-21 14:18   ` Wayne Harris
2020-08-21 17:16     ` Eric Abrahamsen [this message]
2020-08-21 20:30       ` Wayne Harris
2020-08-22  2:27         ` Wayne Harris
2020-08-22 10:45           ` dick.r.chiang
2020-08-22 15:52             ` Wayne Harris
2020-08-22 16:11               ` dick.r.chiang
2020-08-22 17:07                 ` Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=875z9bvs13.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.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.
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 NNTP newsgroup(s).