Re: Nanosleep granularity in MacOS?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=6bOLbKdziUENgMiBdFACYzsWnm3u4vHeJ6F8CrJ/Kzk=; b=BqOYcdxmbUHcmK7cIhRCAH063nhOWQOvAXU3Poe68eB1YO7i4FJnI/GhoyMPV7l9Hv ICZiymZw0OHtinb6r8TZVYAhsGmJqxEMpSxKn5Om7I+O37CYRC4Ldm0hmXrUHCEZmc3m hvyP9EiVgo8rMT07NSC65cx7+5A1W2bWrHQBY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=fS2QJF0w0LpUWlAVFhV6T7OtY+S0QpogjIYv9dmiLXCGWp7K8To9iy7SCTkISO9+uu LH4zP8a3w7/lPWtdK7JFOv1A4nE+Q5cyd+EB2jGnJyiMGF01QLzCRyHHTWtCUPXdV8+X T6qnFebG5oEs7Hg9Vsb4RUZOsHlWyimPiPBOU= P.S. Your name sounds familiar, any relation with Jay 'Saurik' Freeman? On Jan 18, 2010, at 3:50 AM, Jay Reynolds Freeman wrote: If there is a more appropriate mailing list for this question, please suggest it. Perusing the web suggests that there is a "granularity" -- a minimum sleep time -- at which the behavior of the "nanosleep" function changes: For times shorter than the threshold, it simply loops, but for longer times it may in fact actually sleep, and give other processes a chance to run, Does anyone know what this time is (or what other, possibly related times are), for MacOS? The answer is likely processor and clock-speed dependent, so is there a way to obtain this information at run-time on particular Mac platforms? Thanks. -- Jay Reynolds Freeman --------------------- Jay_Reynolds_Freeman@mac.com http://web.mac.com/jay_reynolds_freeman (personal web site) _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/rmuginov%40gmail.com -- Sincerely, Rustam Muginov _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Hello, Jay. I think that mach_absolute_time function does have the best resolution available. I was also discussed in performance-optimization maillist and appeared that mach_absolute_time is the lowest-level recommended function. You might want to check here: http://developer.apple.com/mac/library/qa/qa2004/qa1398.html and here: http://search.lists.apple.com/?q=mach_absolute_time&cmd=Search%21&form=exten... This email sent to rmuginov@gmail.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Rustam Muginov