Re: Reducing interruption latency for feedback-loop
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On 07 Feb 2007, at 18:58, CJ Bell wrote: This is essentially what I have so far: thread_priority_set(...) start while(running) { if(sample is ready) { read/write usleep(0); } } stop Jonas _______________________________________________ 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... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Jonas Maebe