Re: Reducing interruption latency for feedback-loop
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=p76TTqGi/IiIW6bwuIwm4s8pxsk0QvkuJ5W+bTDegf/Mq92PzSwVmOYVg4GqN771Q2QRpQu6+2a8H/5g9d5oVpX2fLhFtVhZrzucCiSiXzWpygICcPGuEgU632xjRyFtS6kGiEDGMHUIwc4U50FDkv9PcH/b2NrOvdh0bo0vLgs= usleep(0) calls through to nanosleep according to the man page, and nanosleep will just perform a spinning loop if you ask it to wait shorter than X ms (I don't know the exact cut-off). That's not what you want, I think. If you just want to give up the current time slice, call pthread_yield_np() (or sched_yield() from sched.h, since the pthread variant just calls through to that on Mac OS X) instead. Thanks! I was calling usleep(0) so that I wouldn't lose thread-priority -- it made a huge difference. -CJ _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
CJ Bell