Re: Can't exec from a Cocoa app?
Re: Can't exec from a Cocoa app?
- Subject: Re: Can't exec from a Cocoa app?
- From: Douglas Davidson <email@hidden>
- Date: Thu, 24 Aug 2006 10:08:27 -0700
On Aug 24, 2006, at 9:48 AM, Tom Harrington wrote:
[And for those wondering why I'm not using something more Cocoaesque,
like using NSTask or asking NSWorkspace to help me out, it's because
this code is in a signal handler function. Since signals are
delivered asynchronously it's generally not a good idea to use any
function calls not specifically documented as being safe for use in
that situation.]
What we typically recommend for signal handlers in Cocoa applications
is that they do nothing significant themselves, but instead provide
something that can be noticed by code outside of the signal-handling
context, where the actual work will be done; for example, by setting
a flag, or sending a Mach message, or writing to a socket. Then it
is fairly easy to handle Mach ports or sockets within the run loop;
you may be able to find code for this in mailing list archives. Of
course, there may be circumstances in your particular case that
militate against this, but that is our general recommendation.
Douglas Davidson
_______________________________________________
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