On 22 December 2016 at 01:42, Eli Zaretskii <eliz@gnu.org> wrote:

> But that doesn't change the fact that it makes more sense to never allow keyboard input to be processed by
> anything other than the main thread?

Why does it make more sense than, say, serialize access to the
minibuffer such that only one thread can access it at a time?

It would, if the minibuffer was the only place where the keyboard was read. However, isn't this problem wider than just the minibuffer?

In my tests with ‘sit-for’ and threads, I noticed that if multiple threads do ‘sit-for’ at the same time, and a press a key, then only one of the threads gets released. As you keep generating input, more and more of the threads exit the call to ‘sit-for’. A central input processing thread would fix this issue too, right?
 
> C-g isn't "normal" keyboard input, is it?

It depends.  It's a bit of both, at least on GUI frames.

Is this related to the messy event loop in GTK Emacs that people were commenting on in some other thread recently?