all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David.Kastrup@t-online.de (David Kastrup)
Cc: "Kai Großjohann" <kai.grossjohann@gmx.net>
Subject: Re: Any idea about what makes Emacs slow reading on pipes?
Date: 18 May 2003 21:46:04 +0200	[thread overview]
Message-ID: <x565o8vy0z.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E19HTRw-00082t-00@fencepost.gnu.org>

Richard Stallman <rms@gnu.org> writes:

>     We might change it so that, after stashing the stuff in a
>     buffer, Emacs looks again if more data is available from the
>     same process.

More data will not be available from the same process, since the
process has not had any chance to get CPU time again for generating
more data.  We are talking about a uniprocessor machine here.  The
only way in which more data could become available is if Emacs
_voluntarily_ yielded the CPU instead of processing what is there.
So the question is how to yield the CPU, and for how long, and when
to stop.

The best possibility would be to resume when either a number of
characters is available (a "read" of a certain size can be satisfied),
or a timeout has occured.  Unfortunately, I don't see how to achieve
this without actually reading the pipe out all of the time.  So we do
need a temporary buffer which we serve _fast_.  If it is full, we
process it, if not, we may wait.  If waiting does not yield new
characters, fire up the filter.  How long to wait, depending on the
past history and the fill level of our buffer?  Good question.

>     If so, also read it and stash it in the buffer, too.
> 
> That is worth trying--it might not be too hard to write.  But I
> think the problem is in Linux, so the real solution is to change
> Linux.

I am following this way by discussing this on the Linux kernel list
and am pretty certain that a future version of Linux might be able to
deal with this gracefully.  But there are other operating systems of
which I believe a majority to be afflicted with this
uniprocessor-specific problem, and older Linux systems will remain
with us for a long time.  It would be good if we could equip Emacs
with a few heuristics that would not cause noticeable degradations on
operating systems that would know how to deal with this scheduling
anomaly, but improved matters on the _many_ systems that don't.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2003-05-18 19:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-16 13:08 Any idea about what makes Emacs slow reading on pipes? David Kastrup
2003-05-16 13:55 ` Andreas Schwab
2003-05-16 17:18 ` Kevin Rodgers
2003-05-16 17:34   ` David Kastrup
2003-05-16 18:38     ` Kevin Rodgers
2003-05-16 18:49       ` David Kastrup
2003-05-16 17:48 ` Jan D.
2003-05-16 18:38   ` David Kastrup
2003-05-16 20:23     ` Jan D.
2003-05-16 21:00     ` Andreas Schwab
2003-05-16 23:17     ` Satyaki Das
2003-05-17  1:50     ` Kim F. Storm
2003-05-17  0:34       ` David Kastrup
2003-05-18  0:31         ` Kim F. Storm
2003-05-17 23:07           ` Stefan Monnier
2003-05-17 23:39           ` David Kastrup
2003-05-18  2:09             ` Stefan Monnier
2003-05-18  8:45             ` Kai Großjohann
2003-05-18 10:12               ` David Kastrup
2003-05-18 19:04               ` Richard Stallman
2003-05-18 19:46                 ` David Kastrup [this message]
2003-05-19  7:33                   ` Kai Großjohann
2003-05-19  8:24                     ` David Kastrup
2003-05-18  8:46             ` Kai Großjohann
2003-05-18 10:03               ` David Kastrup
2003-05-18 15:09                 ` Kai Großjohann
2003-05-18 15:36                   ` David Kastrup
2003-05-18 15:50                     ` Kai Großjohann
2003-05-18 16:28                       ` David Kastrup
2003-05-19  7:26                         ` Kai Großjohann
2003-05-19  8:09                           ` David Kastrup
2003-05-18 19:03           ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=x565o8vy0z.fsf@lola.goethe.zz \
    --to=david.kastrup@t-online.de \
    --cc=dak@gnu.org \
    --cc=kai.grossjohann@gmx.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.