From: "Jan D." <jan.h.d@swipnet.se>
Subject: Re: signal handling bogosities
Date: Tue, 31 Dec 2002 17:54:36 +0100 (MET) [thread overview]
Message-ID: <200212311750.gBVHoo0U025254@stubby.bodenonline.com> (raw)
In-Reply-To: <E18RSll-00025S-00@fencepost.gnu.org> from "Richard Stallman" at dec 26, 2002 02:49:29
>
> FWIW, I believe Xemacs uses a home-brewed event loop. which allows
> it to support such things as opening both X and text-terminal frames
> in the same Emacs instance, for example. very nifty.
>
> The XEmacs developers told me 10 years ago that XEmacs used an
> inside-out structure, where Xt implements the event loop and calls
> Emacs to handle each events. That unnatural structure makes it
> impossible to write your own loop in Lisp. I rejected it.
One could argue that for a GUI application the XEmacs approach is the
natural loop :-)
> They told me that it was impossible to handle Xt with a natural
> structure, where the event loop uses the toolkit as a subroutine, but
> we did it. (Actually I think Paul Reilly did it.)
But not without problems as this discussion shows. Also, there are some
code just to overcome these problems (timers for example) that feels
like a kludge. I see that Emacs does some polling when running under
X, there is a timeout for about half a second for each select call.
I don't know why, but I guess it is related. This makes it hard
to debug events, if nothing else.
I read a paper about event loops on the net some time ago (no URL, sorry),
and it described the problems of integrating several event models.
Say you have some GUI toolkit, perhaps CORBA, some database access
toolkit, and a custom event loop for your application. Trying to
integrate these into one loop is never easy since all these toolkits usually
assume you run their event loop and nothing else. Some are more integration-
friendly than others (X/Xt is very friendly, GTK is very unfriendly).
Threads to the rescue, but that is not always that easy either.
> I will not accept that unnatural structure now, any more than I did 10
> years ago. However, I won't reject all possible changes in the event
> loop. It might be useful to rewrite the event loop in Lisp (keeping
> its present natural structure).
I haven't looked at this in detail, but it seems to me that a lot could be
gained if Emacs could wait for events in some toolkit specific routine,
like XtAppNextEvent for Xt. Now it looks to me it does a select for
the X connection file descriptor. The difference is that if we use
a toolkit routine, timers, signal handlers and idle callbacks and
possible other stuff the toolkit wants to do, gets handled normally.
Has this been considered? It doesn't solve the redrawing while executing
lisp, but helps a bit.
Jan D.
next prev parent reply other threads:[~2002-12-31 16:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <buo3cou2qxx.fsf@mcspd15.ucom.lsi.nec.co.jp>
2002-12-19 14:04 ` signal handling bogosities Gerd Moellmann
2002-12-20 1:44 ` Miles Bader
2002-12-20 10:25 ` Gerd Moellmann
2002-12-20 11:40 ` Kim F. Storm
2002-12-20 11:29 ` Gerd Moellmann
2002-12-25 11:52 ` Michael Livshin
2002-12-26 7:49 ` Richard Stallman
2002-12-31 16:54 ` Jan D. [this message]
2003-01-02 18:38 ` Richard Stallman
2003-01-04 12:33 ` Jan D.
2002-12-18 14:25 Bold by moving pixels problem Robert J. Chassell
2002-12-19 10:15 ` signal handling bogosities Miles Bader
2002-12-20 17:12 ` Richard Stallman
2002-12-20 17:46 ` Eli Zaretskii
2002-12-20 18:35 ` Alex Schroeder
2002-12-20 22:06 ` Miles Bader
2002-12-21 20:26 ` Richard Stallman
2002-12-21 23:42 ` Alex Schroeder
2002-12-23 20:58 ` Richard Stallman
2002-12-22 2:02 ` Miles Bader
2002-12-22 2:27 ` Miles Bader
2002-12-23 20:58 ` 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=200212311750.gBVHoo0U025254@stubby.bodenonline.com \
--to=jan.h.d@swipnet.se \
/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.