2008/12/5 Jean-Daniel Dupas <[EMAIL PROTECTED]>: > The dotnet timer is useless for a lots of cases for one reason: "The method > does not execute on the thread that created the timer" > It uses a theadpool setup by the framework in background.
In my case, I have no need at all, to run the callback from any particular thread. The callback function is handling a shared resource and is thus reentrant and uses a mutex lock to protect the resource. A quite common case – but of course, sometimes it's nice not caring about synchronization. > I really prefere the OS X approach that let you do something similar in 5 > lines of code, but is more flexible, as it also allow you to execute timer > on a predefined thread. A matter of taste – for both approaches. Sometimes one a approach is better than the other and sometimes vice versa. > Now, you can request a wrapper API that create it's own thread, and call a > callback function on a random thread when it triggers, but I doubt they will > include it in Cocoa. I doubt it too... / Påhl _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]