From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: The event handling thread Date: Wed, 21 Dec 2016 19:05:39 +0800 Message-ID: References: <8360mj99oe.fsf@gnu.org> <83fulk610j.fsf@gnu.org> <83wpeu37nq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1147e0722056e40544292294 X-Trace: blaine.gmane.org 1482318510 324 195.159.176.226 (21 Dec 2016 11:08:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2016 11:08:30 +0000 (UTC) To: Eli Zaretskii , =?UTF-8?Q?Elias_M=C3=A5rtenson?= , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 21 12:08:26 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 1cJekv-0007iD-PF for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2016 12:08:21 +0100 Original-Received: from localhost ([::1]:56280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJel0-0004N6-7Z for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2016 06:08:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJeiP-00025K-IA for emacs-devel@gnu.org; Wed, 21 Dec 2016 06:05:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJeiO-00042m-JE for emacs-devel@gnu.org; Wed, 21 Dec 2016 06:05:45 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:36644) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJeiN-00041d-2J; Wed, 21 Dec 2016 06:05:43 -0500 Original-Received: by mail-wm0-x232.google.com with SMTP id g23so145164507wme.1; Wed, 21 Dec 2016 03:05:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=QIg14s6GacN+DVvMTgVp2DiSfO1OgY6DQk9NilOSJ9g=; b=bLKaIVZLYl8SFSKDvnjgFkeRA8TdJaARt5auweeI9wFKZaoQazDDdyYHSvPIY0ByX5 mRkvdRMf5QzMD0BWRPOH2cMX+0Y6ndfl/XjRsI+Z9GaTNKdFMaBSZBmdtUyph5VZ0DBc 1psEA0vagykGJ2ZR8/F2B3WUtruEJceex1D7uaCQnPPKuAF6H8XF8QYDKxV66qrmn92P /8SEFyXVRU8m0s04D7Mbyj5yq27YykXeCyKqSxeM0aB7SaMJu3YjFPbMpPD07nITsdkV Vqb+2nlYETcdE/uO2GcEzSSyC9nVQ/ABwR5Zdktnff+eCiuafgjJzPCEn7nucJ6CVqc/ z1yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=QIg14s6GacN+DVvMTgVp2DiSfO1OgY6DQk9NilOSJ9g=; b=sj0JLV6oGfOK4Qjei7V0pDYeUiLqH4cwoFvTGG+qaNwLqcSOhiwajWpbzOuhueaCDf cLn52qWeg4lDXH2KUscRJWNiyeEzCWmU6ckW/EgDB2hogMgjQlt3mM3QYRInu73cNFv0 5AWt0fd/dEBsFbdH61BvpG6VcyJVshKguJ/3KrxJFApM8zs2emvIK3XQUO++w+f5hzGV I9IsCLT8FOQyi4HscbdfnXdND3RDWZ4Twyw06O6L88PuyAhmwrUQVmbej6IiQBLovi2k AW2noEPO5MLbuJ/WahM/3U0N0QhckXncCwuNpbDo0dfZWVSLeQdQ46JCVeXPjotsUSME yYxQ== X-Gm-Message-State: AIkVDXJtBkA1JBIkQnjrScaL/CNezT63UEkg2kemxVynAl5rCZXf42RV4b4/Q4KKc5k+lTGEiVZ6dC9t9tKl+A== X-Received: by 10.28.111.139 with SMTP id c11mr4544956wmi.139.1482318340438; Wed, 21 Dec 2016 03:05:40 -0800 (PST) Original-Received: by 10.80.135.165 with HTTP; Wed, 21 Dec 2016 03:05:39 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::232 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:210688 Archived-At: --001a1147e0722056e40544292294 Content-Type: text/plain; charset=UTF-8 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? C-g isn't "normal" keyboard input, is it? --001a1147e0722056e40544292294 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2= 1 December 2016 at 09:04, John Wiegley <jwiegley@gmail.com>= wrote:
>>>>> Eli Zaretski= i <eliz@gnu.org> writes:

> To see the above machinery in action, try this:

>=C2=A0 =C2=A0(defun infloop ()
>=C2=A0 =C2=A0 =C2=A0(with-temp-buffer (while t (insert "foo")= )))

>=C2=A0 =C2=A0(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 y= ields.

Ah, this is the bit I was missing. It's clear to me now, thanks.

But that doesn't change the fact that it make= s more sense to never allow keyboard input to be processed by anything othe= r than the main thread? C-g isn't "normal" keyboard input, is= it?=C2=A0
--001a1147e0722056e40544292294--