Re: Thread safety of Bonjour Cocoa classes? (NSNetService, etc.)
Re: Thread safety of Bonjour Cocoa classes? (NSNetService, etc.)
- Subject: Re: Thread safety of Bonjour Cocoa classes? (NSNetService, etc.)
- From: Sean McBride <email@hidden>
- Date: Thu, 14 Feb 2013 16:07:13 -0500
- Organization: Rogue Research Inc.
On Thu, 14 Feb 2013 12:47:13 -0800, Chris Parker said:
>NSNetService (and NSNetServiceBrowser) automatically schedules itself on
>the run loop of the thread it's being created on. If the run loop isn't
>being spun (e.g. on a thread created by detaching a pthread or an
>NSThread) then you won't get callbacks.
Chris,
Thanks for your reply. I create an NSThread with initWithTarget:selector:object: then from the thread's entry function I do [[NSRunLoop currentRunLoop] run] to create and run its runloop forever. The API to my class uses performSelector:onThread: to do all work (like the creation of the NSNetService and NSNetServiceBrowser) on my thread. Does that sound kosher?
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden