Re: Reducing interruption latency for feedback-loop
Re: Reducing interruption latency for feedback-loop
- Subject: Re: Reducing interruption latency for feedback-loop
- From: "CJ Bell" <email@hidden>
- Date: Wed, 7 Feb 2007 10:52:07 -0800
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden