• 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: One thread used per CFSocket?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One thread used per CFSocket?


  • Subject: Re: One thread used per CFSocket?
  • From: Quinn <email@hidden>
  • Date: Tue, 17 Feb 2009 10:09:49 +0000

At 8:49 +0000 14/2/09, Joel Reymont wrote:
From reading the source code, it appears that a separate thread (CFSocketManager) is used per CFSocket. Is my reading correct?

No, you're not reading the code correctly. The dead giveaway is the following:

static void *__CFSocketManagerThread = NULL;

<http://www.opensource.apple.com/darwinsource/10.4/CF-368/RunLoop.subproj/CFSocket.c>

[This link may require an APSL <http://www.opensource.apple.com/apsl/>
account.]

There's only a single static variable to hold a reference to the thread, ergo there's only one thread that handles all of the CFSockets.

If you look at __CFSocketManager in more detail, you'll see it contains a CFAllocatorReallocate to grow the descriptor sets if necessary.

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >One thread used per CFSocket? (From: Joel Reymont <email@hidden>)

  • Prev by Date: Re: Does CFSocket use efficient polling?
  • Next by Date: Re: Looking for CFSocket UPD setup and data-xfer samples/tutorials
  • Previous by thread: One thread used per CFSocket?
  • Next by thread: OS trying to use IPv6 even though it's unavailable
  • Index(es):
    • Date
    • Thread