• 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: NSTimer and trackpad and mouse clicks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer and trackpad and mouse clicks


  • Subject: Re: NSTimer and trackpad and mouse clicks
  • From: Brian Willoughby <email@hidden>
  • Date: Mon, 07 Nov 2011 23:27:44 -0800

On Nov 7, 2011, at 21:21, Kyle Sluder wrote:
On Nov 7, 2011, at 7:56 PM, Tom Jeffries <email@hidden> wrote:
Thanks, Brian- that's an excellent solution. I'm not totally familiar with the way run loops work on OSX, I assumed that NSTimer would automatically function on a different run loop. I was wrong.

Every thread has at most one run loop. The main thread is special in that it has a run loop by default (in Cocoa applications, at least) and its run loop is responsible for dispatching the main Grand Central Dispatch queue's operations.


Your audio engine should really be running in its own entirely separate thread (or set of threads). For best results, it should provide information to and pick up input from the UI in a synchronization-free manner.

Of course this makes the interface between your UI code and your audio engine more complicated, but it also hides that complication under a cleaner internal interface.

Tom's question came from the point of view of CoreMIDI. The audio engine comments above are generally applicable, but not quite exactly as difficult for MIDI as audio.


Brian Willoughby
Sound Consulting

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTimer and trackpad and mouse clicks
      • From: James Chandler Jr <email@hidden>
References: 
 >NSTimer and trackpad and mouse clicks (From: Tom Jeffries <email@hidden>)
 >Re: NSTimer and trackpad and mouse clicks (From: Mark Pauley <email@hidden>)
 >Re: NSTimer and trackpad and mouse clicks (From: Tom Jeffries <email@hidden>)
 >Re: NSTimer and trackpad and mouse clicks (From: Mark Pauley <email@hidden>)
 >Re: NSTimer and trackpad and mouse clicks (From: Brian Willoughby <email@hidden>)
 >Re: NSTimer and trackpad and mouse clicks (From: Tom Jeffries <email@hidden>)
 >Re: NSTimer and trackpad and mouse clicks (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: How to make the binaries smaller?
  • Next by Date: Re: strategies for getting my app's audio working over 48khz HDMI
  • Previous by thread: Re: NSTimer and trackpad and mouse clicks
  • Next by thread: Re: NSTimer and trackpad and mouse clicks
  • Index(es):
    • Date
    • Thread