From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Questions about throw-on-input Date: Mon, 11 May 2020 17:13:28 +0300 Message-ID: <834ksmd0fr.fsf@gnu.org> References: <1f5456b9-1fd6-5084-1578-8f6a413fe1b4@web.de> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="107857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yyoncho@gmail.com, emacs-devel@gnu.org To: Alexander Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 16:17:20 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jY9FA-000RyM-J4 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 16:17:20 +0200 Original-Received: from localhost ([::1]:41106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY9F9-0008U4-LU for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 10:17:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jY9BX-0004mf-5k for emacs-devel@gnu.org; Mon, 11 May 2020 10:13:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36333) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY9BW-00048v-A5; Mon, 11 May 2020 10:13:34 -0400 Original-Received: from [176.228.60.248] (port=1330 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jY9BV-0003wI-Dv; Mon, 11 May 2020 10:13:33 -0400 In-Reply-To: <1f5456b9-1fd6-5084-1578-8f6a413fe1b4@web.de> (message from Alexander Miller on Sun, 10 May 2020 15:47:18 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249784 Archived-At: > From: Alexander Miller > Date: Sun, 10 May 2020 15:47:18 +0200 > Cc: emacs-devel@gnu.org > > Checking (input-pending-p) does not work in this scenario. When your > worker thread is actually busy (simulated by the 10000 calls to random > below) input-pending-p will not return t, no matter how much you hammer > the keyboard in the meatime. The yield-time message will not appear even > once. So it looks like keeping the CPU busy also prevents the processing > of input events. It is unusual for non-main threads to wait for keyboard input descriptor. You shouldn't rely on that because it can only work very rarely, if at all, and when it does, you are likely to see serious problems. Normally, the 'pselect' call issued by a non-main thread will not mark the keyboard descriptor as being waited for. At least, that's my understanding of the code and its implications.