Re: Asynchronous timers (without a run loop)
Re: Asynchronous timers (without a run loop)
- Subject: Re: Asynchronous timers (without a run loop)
- From: Eric Schlegel <email@hidden>
- Date: Fri, 05 Dec 2008 20:25:45 -0800
On Dec 5, 2008, at 3:22 PM, Påhl Melin wrote:
I didn't really decide I shouldn't use a run loop for the timers. I am
porting a library from another platform and just wanted a quick answer
if I could get a similar timer API behavior in either Cocoa, Core
Foundation or BSD Unix (with a preference on low-level for
efficiency), as I was already using. It would save me time and make
the resulting code simpler and probably more robust (since I'm not an
Cocoa/CF expert).
In the spirit of helping to ask better questions...
I think the key piece of information that you left out in your
original question was the API you were using on .Net, and the behavior
you got - that your timer was called on a separate thread, _not_ the
thread that installed the timer. Given that information, it would be
easy to direct you at simply creating a separate thread and using
either NSTimer or CFRunLoopTimer to install your timers, which would
be called on the separate thread, exactly as on .Net.
-eric
_______________________________________________
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