Re: Does CFSocket use efficient polling?
Re: Does CFSocket use efficient polling?
- Subject: Re: Does CFSocket use efficient polling?
- From: Joel Reymont <email@hidden>
- Date: Thu, 12 Feb 2009 21:07:05 +0000
On Feb 12, 2009, at 8:50 PM, Josh Graessley wrote:
In my experience, there are two good reasons to use a thread:
1) You're CPU bound so you need to utilize multiple cores
2) You're using a poorly designed API - synchronous APIs are a good
example
I'm with you Josh! How do I get notified that there's data to be read
from a socket _without_ using a separate thread and without busy-
polling?
I don't know if CFSocket allocates a single buffer and reuses it, for
example.
I want to use a single buffer of an exact size and I don't need NSData
back.
It looks like I need to use the BSD socket API but I suspect that
checking the socket every time my audio playback callback is triggered
may not be optimal. I'd rather check the socket, receive data and post
it to a buffer outside of my audio callback.
Can this actually be done without using a separate thread?
Thanks, Joel
---
http://tinyco.de
--- Mac & iPhone
_______________________________________________
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