Cocoa and signals (was Re: Invoking Force Quit from Cocoa?)
Cocoa and signals (was Re: Invoking Force Quit from Cocoa?)
- Subject: Cocoa and signals (was Re: Invoking Force Quit from Cocoa?)
- From: Alastair Houghton <email@hidden>
- Date: Sat, 1 Oct 2005 19:09:21 +0100
On 1 Oct 2005, at 18:54, Alexander v. Below wrote:
3. On the Mac, it's probably even nicer to send an Apple Event to
ask the other program to terminate before heading for SIGTERM.
A bit off topic, but isn't a Quit Event the same as a SIGQUIT in OS X?
I'd be surprised if it was. SIGQUIT usually means "please terminate
and dump core", so it's quite unlikely that SIGQUIT and a Quit Event
are one and the same thing. Also, Apple Events are delivered to your
program via your event loop, so will be handled synchronously by your
program, whereas SIGQUIT gets delivered via the BSD signal mechanism,
which by its very nature is asynchronous (not just with your event
loop, but also with the normal execution of your program... indeed,
on many systems you can even get signals mid-instruction---typically
in floating point or block operation instructions).
As an aside, it also doesn't appear that the framework sets up a
handler for SIGTERM. It might actually make sense for it to handle
it by queuing up a quit event within the application so that e.g. the
app can ask the user if they'd like to save files. After all, if
they meant "terminate now", they'd have used SIGKILL instead.
Kind regards,
Alastair.
--
http://www.alastairs-place.net
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden