unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Platon Pronko <platon7pronko@gmail.com>
To: 34821@debbugs.gnu.org
Subject: bug#34821: discard_input_tty does not discard pending input, resulting in garbage inserted into the buffer
Date: Sun, 7 Apr 2019 22:06:23 +0300	[thread overview]
Message-ID: <0029f748-36b6-e344-9aef-53f0e2101200@gmail.com> (raw)
In-Reply-To: <83r2ad8yh1.fsf@gnu.org>

> 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?

> You may be right, but my reasoning was that without knowing why
> there's a second buffer-switch event sometimes, we will be unable to
> devise a good solution.  IOW, I think we need to understand the issue
> better before we are ready to discuss a solution.
I agree. I'll look at what causes that second event, I'm quite interested in the mechanics of it anyway.






  reply	other threads:[~2019-04-07 19:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  7:53 bug#34821: discard_input_tty does not discard pending input, resulting in garbage inserted into the buffer Platon Pronko
2019-03-13  8:04 ` Platon Pronko
2019-04-07 16:06 ` Platon Pronko
2019-04-07 16:37   ` Eli Zaretskii
2019-04-07 17:14     ` Platon Pronko
2019-04-07 18:24       ` Eli Zaretskii
2019-04-07 19:06         ` Platon Pronko [this message]
2019-04-07 19:25           ` Eli Zaretskii
2020-05-24  6:23             ` Platon Pronko
2020-05-24  7:08               ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0029f748-36b6-e344-9aef-53f0e2101200@gmail.com \
    --to=platon7pronko@gmail.com \
    --cc=34821@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).