• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reducing interruption latency for feedback-loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Reducing interruption latency for feedback-loop (From: "CJ Bell" <email@hidden>)
 >Re: Reducing interruption latency for feedback-loop (From: Jonas Maebe <email@hidden>)

  • Prev by Date: Re: how to get the serviceID belongs to airport
  • Next by Date: Re: Reducing interruption latency for feedback-loop
  • Previous by thread: Re: Reducing interruption latency for feedback-loop
  • Next by thread: Re: Reducing interruption latency for feedback-loop
  • Index(es):
    • Date
    • Thread