• 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: Sleeping in nanos
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sleeping in nanos


  • Subject: Re: Sleeping in nanos
  • From: Greg <email@hidden>
  • Date: Thu, 8 Feb 2007 12:11:28 -0500


On Feb 8, 2007, at 12:03 PM, Graham J Lee wrote:


I think there's a missed point here; even if the above were false you still wouldn't get the results I think you expect to get. Even if nanosleep() did truly sleep your thread for exactly one nanosecond, the time elapsed between the start of the sleep and the scheduler running your thread again is down to the scheduler, has nothing to do with your thread, and is pretty much guaranteed to be equal to or (more likely) greater than the sleep time requested. As it is, due to hardware limitations it currently takes *much* longer to reawaken your thread than O(ns), so even a perfectly accurate implementation of nanosleep() sucks royally ;-)


Cheers,
Graham.


Thanks for pointing that out. One has to wonder then, why provide such a function to developers and claim that it *can* possibly sleep for the amount of time requested? Like I said before, this function is mainly useful in *time-critical applications*, and in such applications, this unpredictable function is absolutely useless.


- Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Sleeping in nanos
      • From: Terry Lambert <email@hidden>
    • Re: Sleeping in nanos
      • From: Jan Brittenson <email@hidden>
    • Re: [APPL:DarwinKernel] Re: Sleeping in nanos
      • From: "Jay A. Kreibich" <email@hidden>
    • Re: Sleeping in nanos
      • From: Jonas Maebe <email@hidden>
    • Re: Sleeping in nanos
      • From: Graham J Lee <email@hidden>
References: 
 >Sleeping in nanos (From: Greg <email@hidden>)
 >Fwd: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Ed Wynne <email@hidden>)
 >Re: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Terry Lambert <email@hidden>)
 >Re: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Terry Lambert <email@hidden>)
 >Re: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Michael Smith <email@hidden>)
 >Re: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Michael Smith <email@hidden>)
 >Re: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Graham J Lee <email@hidden>)

  • Prev by Date: Re: Sleeping in nanos
  • Next by Date: Re: Sleeping in nanos
  • Previous by thread: Re: Sleeping in nanos
  • Next by thread: Re: Sleeping in nanos
  • Index(es):
    • Date
    • Thread