From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: The event handling thread (was: Threading IO-bound functions) Date: Mon, 19 Dec 2016 09:43:30 -0800 Message-ID: References: <8360mj99oe.fsf@gnu.org> <83fulk610j.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1482169450 15153 195.159.176.226 (19 Dec 2016 17:44:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Dec 2016 17:44:10 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.90 (darwin) Cc: Eli Zaretskii , emacs-devel To: Elias =?utf-8?Q?M=C3=A5rtenson?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 19 18:44:04 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 1cJ1yl-0002aM-Ja for ged-emacs-devel@m.gmane.org; Mon, 19 Dec 2016 18:44:03 +0100 Original-Received: from localhost ([::1]:47029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJ1yq-0005zk-08 for ged-emacs-devel@m.gmane.org; Mon, 19 Dec 2016 12:44:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJ1yI-0005zd-TM for emacs-devel@gnu.org; Mon, 19 Dec 2016 12:43:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJ1yH-00037n-V9 for emacs-devel@gnu.org; Mon, 19 Dec 2016 12:43:34 -0500 Original-Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:33940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJ1yE-00036d-Ht; Mon, 19 Dec 2016 12:43:30 -0500 Original-Received: by mail-pf0-x230.google.com with SMTP id c4so24932133pfb.1; Mon, 19 Dec 2016 09:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version:content-transfer-encoding; bh=27rrvvthmqcEIYaeC0gudjw9AAqurDZ49vKOzzuYe3I=; b=LmaY8ltV74iBGLOEfI4jUK/VXxxIEkVpBJfg5pee2E3F8FLwPAJ42pKcqwKtv49YtZ HZmxeVC+UAYVWCbD4wQl1gi7IkpZMcZpnyNpxWkZn/eGPdoiczpJs0g32ozZUDqdmu+C cbymCurOSl+yPKtcfuQQ8igkyoGHfto06FyQXsSFsHZ74TVSeRl6TXvwHjyz4z1fFQ6C zy0kufiAYAKhTFltnvNwhwKDYFJ2z9VukmKgnPsfRsPPb+VP/ch3mvDxWsubNaSHLuKj QbIfEpbY4T1XT4lOsLz5790jNkbFwE15xhLaFk5X8+Jtj0xTBF9sMljAgsXzNyeHIWzK 8q0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mail-followup-to:mime-version :content-transfer-encoding; bh=27rrvvthmqcEIYaeC0gudjw9AAqurDZ49vKOzzuYe3I=; b=sAI0Mn9HcVdXYa0rFAJXC8OT82P+WYm5HgPkgKs70VDSZZk34Hmm3+3w+/grukENnf PKdEBtVwlEDDIK/qeOakcf4/h8cN/iGVPcVXr33HIpTvw0bTIN+B3WZ/hvMB4xg/7k5Y shPgv7B1aOHYQ0I3rwtB4VCEUH3l1F7PgPbj3t3B0cpgKlZJKnet25yJUs+5tL1CtXoX eFBLLNlyRwdhfi22dBOcZUYnqBTbgp/SekiWnkutv/6jAFBlCUUat9VPHvw1nuY0OO8Q kZnDmYZ0pRCDftyqfHFId8YPV+rJOjsZ7uryYD3F1c059T/3mBhrnaq3W5IULpmzG1F2 6gDA== X-Gm-Message-State: AIkVDXIB+9jE35QnkkAs/WtajBtWFPc07S4J1McB0AoYBtP9qAl6gGQmriAHwLuG1yXBGw== X-Received: by 10.84.241.141 with SMTP id b13mr25674217pll.28.1482169409615; Mon, 19 Dec 2016 09:43:29 -0800 (PST) Original-Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id a11sm32947644pfe.96.2016.12.19.09.43.28 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 19 Dec 2016 09:43:29 -0800 (PST) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 2D3454BA89D7; Mon, 19 Dec 2016 09:43:32 -0800 (PST) In-Reply-To: ("Elias \=\?utf-8\?Q\?M\=C3\=A5rtenson\=22's\?\= message of "Mon, 19 Dec 2016 15:06:32 +0800") Mail-Followup-To: Elias =?utf-8?Q?M=C3=A5rtenson?= , Eli Zaretskii , emacs-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::230 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:210646 Archived-At: >>>>> "EM" =3D=3D Elias M=C3=A5rtenson 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 ab= ove 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. --=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2