• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Asynchronous timers (without a run loop)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous timers (without a run loop)


  • Subject: Re: Asynchronous timers (without a run loop)
  • From: "Påhl Melin" <email@hidden>
  • Date: Thu, 4 Dec 2008 15:17:13 +0100

2008/12/4 Jean-Daniel Dupas <email@hidden>:
> If you want to avoid Cocoa, Cocoa-dev is probably not the best mailing list
> to ask.
> You will have more chance on darwin-dev.

I don't want to avoid Cocoa, but I just haven't found any Cocoa class
that supports timers without a run loop. But maybe I need to switch to
darwin-dev.

> What do you mean by "low-leve" ? What prevent you to use NS classes ?
> Is this contraint preventing you to use CoreFoundation ?  (which is
> low-level IMHO).

Nothing prevents me from using NS classes per se. I will use the
timers in a C++ class and want to get a callback to a normal
function—not calling a selector on an Objective-C class that most NS
classes would do. And since it's supposed to be the lowest level of my
architecture I want it to be as efficient as possible.

The only problem I have is that I will run the timers on threads
without run loops so both NSTimer and CFRunLoopTimer (I didn't find
any reference information about CFTimer on ADC) are impossible to use.

> If you want lower level primitive, you can use kevent's timers, or if you
> want really low-level, there is a mach timer API, but I don't think it is
> considere public as the header cannot be found in /usr/include/mach

In the man page for kevent it says that kevent timers are not
supported ("EVFILT_TIMER This filter is currently unsupported."). I
just assumed that the man page was correct and haven't made any tests.
Are you sure kevent timers are implemented in Mac OS X? When it comes
to Mach timers I wouldn't dare to use that in a commercial product
since Apple seems to ask developers to keep away from Mach.

> Anyway, that's the API used in CoreFoundation for CFTimer and declared in
> mk_timer.h (see XNU sources for details). But I wont go this way in a
> shipping product.

Agree... I will keep away from any private API:s.

/ 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

  • Follow-Ups:
    • Re: Asynchronous timers (without a run loop)
      • From: Joseph Kelly <email@hidden>
    • Re: Asynchronous timers (without a run loop)
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Asynchronous timers (without a run loop) (From: "Påhl Melin" <email@hidden>)
 >Re: Asynchronous timers (without a run loop) (From: Nathan Day <email@hidden>)
 >Re: Asynchronous timers (without a run loop) (From: "Påhl Melin" <email@hidden>)
 >Re: Asynchronous timers (without a run loop) (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Asynchronous timers (without a run loop)
  • Next by Date: Re: Asynchronous timers (without a run loop)
  • Previous by thread: Re: Asynchronous timers (without a run loop)
  • Next by thread: Re: Asynchronous timers (without a run loop)
  • Index(es):
    • Date
    • Thread