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 21:17:54 +0300 Message-ID: <83o8qu9vzh.fsf@gnu.org> References: <1f5456b9-1fd6-5084-1578-8f6a413fe1b4@web.de> <834ksmd0fr.fsf@gnu.org> <83d07abg0v.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="42569"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alexanderm@web.de, yyoncho@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 20:22:44 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 1jYD4e-000Azu-99 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 20:22:44 +0200 Original-Received: from localhost ([::1]:37612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYD4d-0003av-91 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 14:22:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYD04-0006Zy-7O for emacs-devel@gnu.org; Mon, 11 May 2020 14:18:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43305) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYD03-00077x-N1; Mon, 11 May 2020 14:17:59 -0400 Original-Received: from [176.228.60.248] (port=4335 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYD02-0006zC-Kg; Mon, 11 May 2020 14:17:59 -0400 In-Reply-To: (message from Stefan Monnier on Mon, 11 May 2020 13:27:05 -0400) 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:249853 Archived-At: > From: Stefan Monnier > Cc: alexanderm@web.de, yyoncho@gmail.com, emacs-devel@gnu.org > Date: Mon, 11 May 2020 13:27:05 -0400 > > >> > 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. > >> Should input-pending-p and friends catch that case and signal an error, then? > > Do we want that? > > I don't know. But hanging because `select` doesn't return the needed > information doesn't seem right either. I don't understand: input-pending-p doesn't hang. Were you thinking about while-no-input? > Maybe rather than signal an error, we should somehow make the main > thread run that code, so as to return the right answer? Maybe. But that could be tricky, implementation-wise.