From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34821: discard_input_tty does not discard pending input, resulting in garbage inserted into the buffer Date: Sun, 07 Apr 2019 22:25:28 +0300 Message-ID: <83ftqt8vo7.fsf@gnu.org> References: <6e2317c9-5063-3718-740e-f53c70f5db5b@gmail.com> <83v9zp93gq.fsf@gnu.org> <492c723c-6ba9-24da-108f-b25cef0dd54e@gmail.com> <83r2ad8yh1.fsf@gnu.org> <0029f748-36b6-e344-9aef-53f0e2101200@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="68645"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34821@debbugs.gnu.org To: Platon Pronko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 07 21:26:39 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDDR7-000HkO-Or for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Apr 2019 21:26:37 +0200 Original-Received: from localhost ([127.0.0.1]:42710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDDR6-00026h-Ou for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Apr 2019 15:26:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDDQZ-0001t6-1s for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 15:26:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDDQY-0002J9-42 for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 15:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35181) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDDQX-0002Iz-Uj for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 15:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDDQX-0005ZN-MO for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 15:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Apr 2019 19:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34821 X-GNU-PR-Package: emacs Original-Received: via spool by 34821-submit@debbugs.gnu.org id=B34821.155466514821386 (code B ref 34821); Sun, 07 Apr 2019 19:26:01 +0000 Original-Received: (at 34821) by debbugs.gnu.org; 7 Apr 2019 19:25:48 +0000 Original-Received: from localhost ([127.0.0.1]:48725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDDQJ-0005Ys-Px for submit@debbugs.gnu.org; Sun, 07 Apr 2019 15:25:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDDQH-0005Ye-2O for 34821@debbugs.gnu.org; Sun, 07 Apr 2019 15:25:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDDQB-0002AI-KO; Sun, 07 Apr 2019 15:25:39 -0400 Original-Received: from [176.228.60.248] (port=3162 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hDDQ7-0008IO-4N; Sun, 07 Apr 2019 15:25:35 -0400 In-reply-to: <0029f748-36b6-e344-9aef-53f0e2101200@gmail.com> (message from Platon Pronko on Sun, 7 Apr 2019 22:06:23 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157322 Archived-At: > From: Platon Pronko > Date: Sun, 7 Apr 2019 22:06:23 +0300 > > > What do you mean by "run concurrently"? Emacs is pretty much a single > > threaded program, and there's only one Lisp thread running at any > > given time, which will execute both calls. > > My knowledge of Emacs internals is pretty thin indeed. But since adding sleep-for results in reordering of events, I thought that there are at least different threads that compete for execution (concurrent, maybe not parallel). Also I noticed that for example read_char() calls can block for quite a lot of time, while Lisp code continues to run. Perhaps there is one Lisp thread and some other background C threads? No, there's just one thread. The only other one I can think of is the code of xterm itself.