Re: Objective-C in signal handlers (was Re: Inter process communication question)
Re: Objective-C in signal handlers (was Re: Inter process communication question)
- Subject: Re: Objective-C in signal handlers (was Re: Inter process communication question)
- From: Douglas Davidson <email@hidden>
- Date: Wed, 5 Feb 2003 18:44:47 -0800
On Wednesday, February 5, 2003, at 04:24 PM, Greg Parker wrote:
In general, you can't do anything inside a signal handler other than
write() to a pipe or set a global variable that some other thread is
watching. exit() is definitely unsafe because it might call atexit()
handlers; use _exit() instead. unlink() might be safe if it's just a
single system call, but I'm not sure about that.
I am given to understand that sending a Mach message via mach_msg() is
also safe. There was a recent post on one or another mailing list
showing an example of sending a Mach message in a signal handler and
catching it with a run loop source. Writing to a socket or pipe could
also serve the same purpose.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.