Skip navigation.
 
mlRe: Can't exec from a Cocoa app?
FROM : Douglas Davidson
DATE : Thu Aug 24 19:08:27 2006

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

Related mailsAuthorDate
mlCan't exec from a Cocoa app? Tom Harrington Aug 24, 00:46
mlRe: Can't exec from a Cocoa app? Andrew Farmer Aug 24, 01:14
mlRe: Re: Can't exec from a Cocoa app? Tom Harrington Aug 24, 01:47
mlRe: Can't exec from a Cocoa app? Uli Kusterer Aug 24, 11:56
mlRe: Can't exec from a Cocoa app? Andrew Farmer Aug 24, 17:58
mlRe: Re: Can't exec from a Cocoa app? Tom Harrington Aug 24, 18:48
mlRe: Can't exec from a Cocoa app? Douglas Davidson Aug 24, 19:08