Re: Reducing interruption latency for feedback-loop
Re: Reducing interruption latency for feedback-loop
- Subject: Re: Reducing interruption latency for feedback-loop
- From: Jonas Maebe <email@hidden>
- Date: Wed, 7 Feb 2007 19:11:29 +0100
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
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.
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden