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: Delivering SIGIO when several threads are active? Date: Fri, 30 Dec 2016 20:37:09 +0200 Message-ID: <83wpehs1pm.fsf@gnu.org> References: <8360m1u311.fsf@gnu.org> <8e01d8c5-66fa-fcb8-ef0e-74ca10a72317@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1483123045 9541 195.159.176.226 (30 Dec 2016 18:37:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2016 18:37:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 30 19:37:21 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 1cN23K-0001LF-03 for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2016 19:37:18 +0100 Original-Received: from localhost ([::1]:41118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN23N-0000P5-7p for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2016 13:37:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN23G-0000Ox-PV for emacs-devel@gnu.org; Fri, 30 Dec 2016 13:37:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cN23D-0001Qa-LO for emacs-devel@gnu.org; Fri, 30 Dec 2016 13:37:14 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN23D-0001QV-Hk; Fri, 30 Dec 2016 13:37:11 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2909 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cN23C-0006dI-PL; Fri, 30 Dec 2016 13:37:11 -0500 In-reply-to: <8e01d8c5-66fa-fcb8-ef0e-74ca10a72317@cs.ucla.edu> (message from Paul Eggert on Fri, 30 Dec 2016 09:54:01 -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:211001 Archived-At: > From: Paul Eggert > Date: Fri, 30 Dec 2016 09:54:01 -0800 > > Eli Zaretskii wrote: > > When SIGIO is received by some thread, we currently deliver it to the > > main thread, see deliver_input_available_signal and > > deliver_process_signal. Is that appropriate when more than one thread > > is active? > > Such signals have been delivered to the main thread for quite some time, and > this has worked well enough; is there something different about the concurrency > code that now makes this behavior inappropriate? I don't know, that's why I asked. For example, what if another thread is waiting on the keyboard descriptor and wants to handle keyboard input, or wants to receive X events? > On GNU/Linux, process signals get sent to the main thread unless the main thread > is blocking them (or if a few less-common situations arise, e.g., the main > thread is exiting). And what happens in those exceptional cases? > Hmm, I see that the recent changes use mixed terminology. Until now, Emacs has > called the initial thread the "main thread", but the recent code sometimes calls > it the "primary thread". We shouldn't have two names for the same thing. I'll > look into fixing that. "Primary thread" is the name of the main thread.