unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reworked input handling via read_socket_hook interface
@ 2004-03-03 14:33 Kim F. Storm
  2004-03-08 18:24 ` Harald Maier
  0 siblings, 1 reply; 5+ messages in thread
From: Kim F. Storm @ 2004-03-03 14:33 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-15  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-03 14:33 Reworked input handling via read_socket_hook interface Kim F. Storm
2004-03-08 18:24 ` Harald Maier
2004-03-11 14:26   ` Juanma Barranquero
2004-03-13 10:46     ` Jason Rumney
2004-03-15  1:39       ` Juanma Barranquero

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).