• 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: How to set scheduling in NSThread based application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set scheduling in NSThread based application


  • Subject: Re: How to set scheduling in NSThread based application
  • From: Half Activist <email@hidden>
  • Date: Tue, 13 Feb 2007 08:35:39 +0100

Hi Gilles,
I think Shawn Erickson is right, if you've got to wait for 500ms at each loop,
you should actually wait for (500ms-timePollingTook) to be more precise.

It doesn't ensure that your thread will wake up every 500ms,
- because nanosleep isn't that accurate and computing the time needed
to sleep itself takes some time
- nanosleep can return EINTR if it's been interrupted by a signal,
so you should wait a little more time if it woke up too early.
- you can't (almost) run a time critical operation on a time sharing
system, the problem of accuracy getting bigger with system load


Realtime capabilities of Mac OS X may come to your help,but I don't really know,
I might be totally wrong.


Regards

PS: maybe you could give a look at pthread_cond_timedwait
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: How to set scheduling in NSThread based application
      • From: Gilles Celli <email@hidden>
References: 
 >How to set scheduling in NSThread based application (From: Gilles Celli <email@hidden>)

  • Prev by Date: NSTableView and Releasing window controllers
  • Next by Date: Re: Printing crash
  • Previous by thread: Re: How to set scheduling in NSThread based application
  • Next by thread: Re: How to set scheduling in NSThread based application
  • Index(es):
    • Date
    • Thread