Re: NSTimer and trackpad and mouse clicks
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