• 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: Alternative to Delay()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alternative to Delay()


  • Subject: Re: Alternative to Delay()
  • From: Philippe Wicker <email@hidden>
  • Date: Tue, 29 Jul 2003 21:10:15 +0200

On Tuesday, July 29, 2003, at 08:55 PM, Chris Reed wrote:

On Tuesday, Jul 29, 2003, at 01:05 US/Central, Philippe Wicker wrote:

When you call usleep() for say 1 second, the thread (in your case the
UI thread) in which you made that call is waiting for this delay to end
up and then won't go back to the EventLoop for this duration of 1 sec.
Using a CFRunLoopTimer is much better because user events may still be
processed. Here is the code (from a C++ program) to setup a
CFRunLoopTimer.

A key point here is that usleep() will sleep only the thread on which it is called. So if you have a CoreAudio IOProc running, that will continue to work.

Yeah, this is the miracle of multithreading :-)

The user just won't be able to operate any UI elements. And if the delay is long enough, the spinning rainbow cursor (whatever it's called) will appear, indicating the main run loop is not responding.

-chris


Philippe Wicker
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Alternative to Delay() (From: Chris Reed <email@hidden>)

  • Prev by Date: Re: Alternative to Delay()
  • Next by Date: Re: question about Audio Converter: channel mapping without rate conversion?
  • Previous by thread: Re: Alternative to Delay()
  • Next by thread: Re: Alternative to Delay()
  • Index(es):
    • Date
    • Thread