Re: Run loops
Re: Run loops
- Subject: Re: Run loops
- From: Douglas Davidson <email@hidden>
- Date: Fri, 5 Jul 2002 17:44:52 -0700
On Wednesday, July 3, 2002, at 02:41 PM, Mike Laster wrote:
How do I externally force a run loop to "wake up"?
What I'm trying to do is have my server gracefully shutdown after
receiving
a SIGINT.
Very few calls are async-signal-safe. I am told that send() and
mach_msg() are among them. So, one approach would be to set up an
appropriate run loop source (CFSocket, for a socket, or CFMachPort, for
a Mach port) and message the underlying socket or Mach port from your
signal handler. The Mach port approach probably has lower overhead,
but you may be more familiar with the socket approach; socketpair() is
useful for this sort of thing.
Douglas Davidson
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
References: | |
| >Run loops (From: Mike Laster <email@hidden>) |