Re: How do I use NSStream with dispatch queues?
Re: How do I use NSStream with dispatch queues?
- Subject: Re: How do I use NSStream with dispatch queues?
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 20 Mar 2012 10:41:45 +0000
On 20 Mar 2012, at 02:55, Mark Pauley wrote:
> Jens: you'll have to find some way to bridge your gcd queues back to the runloop on which the protocol is invoked. I would recommend using a CFRunLoopSource that you message, using a queue as the method of message passing from your gcd code.
Don't forget CFRunLoopPerformBlock. I only say this because, *shrug*, I always forget it )-:
Ultimately you're going to have to have a thread on which to schedule your run loop sources. You can either use the main thread, with all of its potential pitfalls, or create your own thread; there is no other thread you can reliably piggyback on. Once you've accepted the inevitability of using your own thread, it's just a question of how best to manage that thread. CFRunLoopPerformBlock is a good weapon in that war IMO.
Share and Enjoy
--
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