• 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: Asynchronous sockets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous sockets?


  • Subject: Re: Asynchronous sockets?
  • From: Becky Willrich <email@hidden>
  • Date: Wed, 6 Feb 2002 16:12:22 -0800

Ah, run loop polling instead. I expect that all CFSocket does is call
select() in the run loop? I suppose that could be convenient for some
applications.

No; the run loop does not poll in the sense you mean. Each iteration of the run loop, it looks for events that need to be dispatched. If none are found, the run loop essentially puts that thread to sleep, and the thread will not wake until it is told that an event has arrived (or a timeout occurs, if the run loop was run with one). CFSocket does the necessary magic to monitor its socket separately, and wake the run loop if/when activity appears on the socket.

The distinction is, I suppose, minor, but it means the thread is completely quiet (consuming no CPU) while waiting for events.

REW
_______________________________________________
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: 
 >Re: Asynchronous sockets? (From: Duane Murphy <email@hidden>)

  • Prev by Date: RE: MoreSCF1.0d3 and root privilege
  • Next by Date: Re: Asynchronous sockets?
  • Previous by thread: Re: Asynchronous sockets?
  • Next by thread: Re: Asynchronous sockets?
  • Index(es):
    • Date
    • Thread