Re: Asynchronous timers (without a run loop)
Re: Asynchronous timers (without a run loop)
- Subject: Re: Asynchronous timers (without a run loop)
- From: "Påhl Melin" <email@hidden>
- Date: Fri, 5 Dec 2008 15:08:46 +0100
2008/12/4 Jean-Daniel Dupas <email@hidden>:
> My understanding is that ALL threads have a runloop (from the CFRunLoop
> doc):
>
> «There is exactly one run loop per thread. You neither create nor destroy a
> thread's run loop. Core Foundation automatically creates it for you as
> needed. »
>
> As CoreFoundation is not part of Cocoa, I doubt that only Cocoa thread can
> have a CFRunLoop. (In fact, I do not doubt, i'm pretty sure CoreFoundation
> is based on pthread and do not use Cocoa at all).
>
> I did tool that do not use obj-c at all and use pthread and CFRunLoop to
> managed networks events (using CFSocket) and it works just as it should.
After skimming the "Threading Programming Guide",I realize you are
right about the run loops. All threads have a run loop, including
pthread-created ones. But you have to configure and start the run loop
for all threads other than the main thread. I'm learning new stuff all
the time... :-)
/ Påhl
_______________________________________________
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