From: Andrew Choi <akochoi@shaw.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Mac OS X - Hang / C-g problem patch
Date: Thu, 05 Dec 2002 16:47:19 -0700 [thread overview]
Message-ID: <m2k7iovxiw.fsf@owlbear.local> (raw)
In-Reply-To: <1DB308BA-086F-11D7-AADA-00039390AB82@mac.com>
Steven Tamm <steventamm@mac.com> writes:
> I thought about doing it this way, because I wanted to avoid polling.
> And the call to CheckEventQueueForUserCancel I didn't even bother
> trying because to get C-g to work in the same manner would be quite
> expensive. (To do it you would have to put in a call to RNE() for a
> non-existent event type before calling FindSpecificEventsInQueue).
Hi Steven,
I'm not sure it will be much worse than CheckEventQueueForUserCancel
unless we code it up and run a profiler on it. Most likely, the event
queue will just be empty most of the time we check it.
Polling the event queue every time through eval will no doubt cost an
overhead. Polling is not a bad solution to detect the cancel key in
`select' and `read' though.
> There is also a third way. Use osx's global hotkeys. The good/bad
> thing about global hotkeys is that the events are sent to every
> application that cares regardless of whether they were the frontmost
> application. Fork off a process that registers C-g as a global
> hotkey. Whenever that process gets the hotkey and its parent app is
> the frontmost process, send a kill(SIGINT). I sent this to the carbon
> list yesterday and am waiting for the guy from apple to respond. If
> this works with little hassle, I would prefer this solution. This
> would work in all circumstances and would not require putting in
> patches everywhere to check if C-g is on the system queue.
>
> What do you think?
That doesn't seem like a good solution: an event that every application
sees? But please do let me know what additional information you can get
from the carbon mailing list. In terms of program architecture and
efficiency, your very first attempt was the best: using a separate
thread to capture all input and pass that on to a main thread. But hey
I'm not working on it, so I really shouldn't be saying anything :-).
Andrew.
next prev parent reply other threads:[~2002-12-05 23:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-04 18:06 Mac OS X - Hang / C-g problem patch Steven Tamm
2002-12-05 6:48 ` Andrew Choi
2002-12-05 16:32 ` Steven Tamm
2002-12-05 23:47 ` Andrew Choi [this message]
2002-12-06 18:15 ` Steven Tamm
2002-12-08 6:15 ` Steven Tamm
2002-12-08 20:51 ` Andrew Choi
2002-12-09 10:13 ` dme
2002-12-09 16:42 ` Andrew Choi
2002-12-09 18:09 ` Steven Tamm
2002-12-10 12:38 ` dme
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=m2k7iovxiw.fsf@owlbear.local \
--to=akochoi@shaw.ca \
--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 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.