• 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: Jan Brittenson <email@hidden>
  • Date: Thu, 08 Feb 2007 14:13:53 -0800

Jan Brittenson wrote:
Greg wrote:
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?
The purpose of nanosleep as defined by the realtime extension of POSIX 1.1-1990 is
to address shortcomings of usleep. The two issues are 1) reliance on signals (typically
SIGALRM) or other limited resources making usleep unreentrant and non-thread
safe, and 2) some tweaks to the call interface to indicate whether it was aborted by
a signal or ran to completion. (usleep returns the remaining time but doesn't
indicate why when it returns early.) The purpose of nanosleep is *not* to improve the
timing, but to standardize and clean up the behavior of usleep.
Oops, on checking the standard I see the purpose was also to improve the precision
of the time value. But there's no mandated timing accuracy, it's completely up to the
implementation.


_______________________________________________
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


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>)
 >Re: Sleeping in nanos (From: Greg <email@hidden>)
 >Re: Sleeping in nanos (From: Jan Brittenson <email@hidden>)

  • Prev by Date: Re: Sleeping in nanos
  • Next by Date: Re: Examining kernel thread state at run-time
  • Previous by thread: Re: Sleeping in nanos
  • Next by thread: Re: Sleeping in nanos
  • Index(es):
    • Date
    • Thread