• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Run loops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Run loops
      • From: Mike Laster <email@hidden>
References: 
 >Run loops (From: Mike Laster <email@hidden>)

  • Prev by Date: Re: Using CFSocket to connect
  • Next by Date: Re: Run loops
  • Previous by thread: Run loops
  • Next by thread: Re: Run loops
  • Index(es):
    • Date
    • Thread