From: gerd.moellmann@t-online.de (Gerd Moellmann)
Cc: emacs-devel@gnu.org
Subject: Re: signal handling bogosities
Date: 20 Dec 2002 11:25:41 +0100 [thread overview]
Message-ID: <86smwt9eca.fsf@gerd.free-bsd.org> (raw)
In-Reply-To: <buo4r99a2ga.fsf@mcspd15.ucom.lsi.nec.co.jp>
Miles Bader <miles@lsi.nec.co.jp> writes:
> Perhaps I'm confused, but why can't the existing code that runs from the
> signal handler just be called from the event loop instead, at least as
> an easy first-step?
>
> For instance, if the signal handler currently looks like:
>
> void signal_handler (...)
> {
> if (some_test)
> do_mouse_stuff (mouse_info);
> else if (some_other_test)
> do_exposure_stuff (other info);
> }
>
> change it to be like:
>
> void signal_handler (...)
> {
> if (some_test)
> queue_mouse_event (mouse_info);
> else if (some_other_test)
> queue_exposure_event (exposure_info);
> }
>
> void event_loop_function (...)
> {
> while (event in event loop)
> {
> ...
> if (event->type == mouse_event)
> do_mouse_stuff (event->mouse_info)
> else if (event->type == exposure_event)
> do_exposure_stuff (event->exposure_info)
> ...
> }
> }
>
> In other words, re-use as much of the existing code as possible, but
> change the place where it's called.
What I was thinking about as "event loop" is a toolkit's event loop,
like XtAppMainLoop etc. for Xt, for instance.
I must admit that I never thought about using a home-brewed event
loop, so I can't say much about what that entails, sorry.
next prev parent reply other threads:[~2002-12-20 10:25 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 [this message]
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.
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
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=86smwt9eca.fsf@gerd.free-bsd.org \
--to=gerd.moellmann@t-online.de \
--cc=emacs-devel@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).