all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: "Elias Mårtenson" <lokedhs@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: The event handling thread (was: Threading IO-bound functions)
Date: Mon, 19 Dec 2016 09:43:30 -0800	[thread overview]
Message-ID: <m2a8brx1a5.fsf_-_@newartisans.com> (raw)
In-Reply-To: <CADtN0WKmYP4NX8D0fQw1OYY5-XU1b1ioS3ek0APZs8LQRpURMg@mail.gmail.com> ("Elias \=\?utf-8\?Q\?M\=C3\=A5rtenson\=22's\?\= message of "Mon, 19 Dec 2016 15:06:32 +0800")

>>>>> "EM" == Elias Mårtenson <lokedhs@gmail.com> writes:

EM> Now, my thoughts on this is that keyboard entry is an inherently
EM> single-threaded operation *from the user's point of view* and that the
EM> Emacs platform should enforce this. Thus, keyboard input should only be
EM> allowed from the main thread.

I too had thought keyboard events would be managed by an IO queueing thread,
and dispatched to other threads when relevant (i.e., when the receipt of IO
preempted another thread that was "awaiting input").

That is, I never thought event handling would be entirely cooperative, since
the user invoking a command should suspend what Emacs is doing, unless what
Emacs was doing was awaiting input.

Since there's some confusion on this point -- and maybe what I've stated above
doesn't make sense, since it could impose concurrency in places we've not
thought about yet -- I'd like us to discuss this a bit more.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



  parent reply	other threads:[~2016-12-19 17:43 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         ` John Wiegley [this message]
2016-12-20 16:08           ` The event handling thread (was: Threading IO-bound functions) 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 ` Threading IO-bound functions Ken Raeburn

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=m2a8brx1a5.fsf_-_@newartisans.com \
    --to=jwiegley@gmail.com \
    --cc=eliz@gnu.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.