all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Raeburn <raeburn@raeburn.org>
To: "Elias Mårtenson" <lokedhs@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Threading IO-bound functions
Date: Fri, 16 Dec 2016 17:05:36 -0500	[thread overview]
Message-ID: <83637909-4303-471C-8CED-9BF0377554F9@raeburn.org> (raw)
In-Reply-To: <CADtN0WLFxqotPLo0ihPcQAAUVR8hxf53fB9-21rQfn6v3LwyFA@mail.gmail.com>


On Dec 14, 2016, at 23:01, Elias Mårtenson <lokedhs@gmail.com> wrote:

> The number one function that I call that sometimes hang for a significant amount of time is ‘gnus’. I decided to try running it in a thread, and it worked surprisingly well. Initial loading of the messages can now be done in the background.

I’m a bit surprised… pleased, but surprised… :-)

> 
> To prevent myself from running this function more than once at the same time, I created a wrapper function for this, and I have extracted it into a macro.
> 
> I'd like to have people's opinions on this strategy, and if it might be reasonable to default ‘gnus’ to do this when run on Emacs versions with concurrency support.

For a few things I think it might be reasonable.  But with something like Gnus, there are many things one might want to do in background (fetch the initial list of newsgroups and article counts, update that list, fetch article lists when entering a newsgroup), and — just generally speaking — each of them has to lock out all the others, lest they stomp on each others’ data structures.

The one advantage the “gnus” command has, specifically, compared to the whole rest of Gnus, is that it can do the initial setting up of those data structures.  If the group buffer isn’t ready for command input (what key bindings are applicable at that point?), it’s harder to trigger other Gnus commands to run.

Though, what about sending email with message mode?  If I use a “Gcc:” header to save sent emails in an IMAP folder, what happens if Gnus is only part-way set up?

When do gnus-demon timers get set up?  Can they fire before gnus is ready?

Etc….

Ken


      parent reply	other threads:[~2016-12-16 22:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15  4:01 Threading IO-bound functions Elias Mårtenson
2016-12-16 15:26 ` Eli Zaretskii
2016-12-19  3:03   ` Elias Mårtenson
2016-12-19  3:39     ` Eli Zaretskii
2016-12-19  7:06       ` Elias Mårtenson
2016-12-19 17:32         ` Eli Zaretskii
2016-12-19 17:43         ` The event handling thread (was: Threading IO-bound functions) John Wiegley
2016-12-20 16:08           ` Eli Zaretskii
2016-12-21  1:04             ` The event handling thread John Wiegley
2016-12-21 11:05               ` Elias Mårtenson
2016-12-21 17:42                 ` Eli Zaretskii
2016-12-22  3:12                   ` Elias Mårtenson
2016-12-22 17:37                     ` Eli Zaretskii
2016-12-16 22:05 ` Ken Raeburn [this message]

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=83637909-4303-471C-8CED-9BF0377554F9@raeburn.org \
    --to=raeburn@raeburn.org \
    --cc=emacs-devel@gnu.org \
    --cc=lokedhs@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.