[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The event handling thread

From: Eli Zaretskii
Subject: Re: The event handling thread
Date: Wed, 21 Dec 2016 19:42:28 +0200

> From: Elias Mårtenson <address@hidden>
> Date: Wed, 21 Dec 2016 19:05:39 +0800
> On 21 December 2016 at 09:04, John Wiegley <address@hidden> wrote:
>  >>>>> Eli Zaretskii <address@hidden> writes:
>  > To see the above machinery in action, try this:
>  > (defun infloop ()
>  > (with-temp-buffer (while t (insert "foo"))))
>  > (make-thread #'infloop "thread-loop")
>  > As soon as you start the looping thread, any keyboard input, like M-x or
>  > cursor motion commands, doesn't have any effect, until you type C-g (which
>  > causes the looping thread to exit), because the looping thread never 
> yields.
>  Ah, this is the bit I was missing. It's clear to me now, thanks.
> 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?

> C-g isn't "normal" keyboard input, is it? 

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]