From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: The event handling thread Date: Wed, 21 Dec 2016 19:42:28 +0200 Message-ID: <831sx12n7f.fsf@gnu.org> References: <8360mj99oe.fsf@gnu.org> <83fulk610j.fsf@gnu.org> <83wpeu37nq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1482342203 28954 195.159.176.226 (21 Dec 2016 17:43:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2016 17:43:23 +0000 (UTC) Cc: lokedhs@gmail.com, emacs-devel@gnu.org To: Elias =?utf-8?Q?M=C3=A5rtenson?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 21 18:43:20 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJkv6-0006mP-Fw for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2016 18:43:16 +0100 Original-Received: from localhost ([::1]:58273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJkvB-0000iL-4w for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2016 12:43:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJkux-0000dp-RM for emacs-devel@gnu.org; Wed, 21 Dec 2016 12:43:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJkut-0008C2-VH for emacs-devel@gnu.org; Wed, 21 Dec 2016 12:43:07 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJkut-0008Bx-SL; Wed, 21 Dec 2016 12:43:03 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4192 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cJkus-0007Bq-2N; Wed, 21 Dec 2016 12:43:03 -0500 In-reply-to: (message from Elias =?utf-8?Q?M=C3=A5rtenson?= on Wed, 21 Dec 2016 19:05:39 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210702 Archived-At: > From: Elias MÃ¥rtenson > Date: Wed, 21 Dec 2016 19:05:39 +0800 > > On 21 December 2016 at 09:04, John Wiegley wrote: > > >>>>> Eli Zaretskii 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.