all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Subject: Reworked input handling via read_socket_hook interface
Date: 03 Mar 2004 15:33:11 +0100	[thread overview]
Message-ID: <m33c8quhjs.fsf@kfs-l.imdomain.dk> (raw)


[Repost -- I sent this to emacs-devel (aka. /dev/null) on Feb. 28]

Following my recent changes to read_avail_input that reduced the size
of the event buffer, a number of users reported aborts in the
read_socket_hook functions on X and W32, as these were not prepared
for the input event buffer to overflow.

To overcome the problems, I temporarily increased the buffer size.

The reason for reducing the size was that profiling had shown that the
initialization of the large buffer took a significant amount of CPU
cycles.


I have now committed more radical changes in the interface to
read_socket_hook which I hope will fix this problem permanently.

Previously, the caller of read_socket_hook had to allocate a large
input_event buffer and initialize it before calling read_socket_hook,
and upon return, it had to call kbd_buffer_store_event on each event,
stopping after a quit_char event.

Now, the read_socket_hook functions use a single local input event to
process input, and immediately stores the event into the kbd_buffer
fifo via a new kbd_buffer_store_event_hold function.

The kbd_buffer_store_event_hold is similar to kbd_buffer_store_event,
but it treats quit events differently:
- it stores the quit event in a temporary event (via hold_quit arg),
- it discards further events stored after the quit event.

When read_socket_hook returns, the caller (e.g. read_avail_input)
stores the hold_quit event with kbd_buffer_store_event, which again
triggers the interrupt_signal.


I have modified all of the X, W32, and MAC versions, but I have only
tested on X and -nw on GNU/Linux, so there might be problems on W32
and MAC.  Please check and report any problems to me.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

             reply	other threads:[~2004-03-03 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-03 14:33 Kim F. Storm [this message]
2004-03-08 18:24 ` Reworked input handling via read_socket_hook interface Harald Maier
2004-03-11 14:26   ` Juanma Barranquero
2004-03-13 10:46     ` Jason Rumney
2004-03-15  1:39       ` Juanma Barranquero

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=m33c8quhjs.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    /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.