Re: Run Loops and CFMessagePorts
Re: Run Loops and CFMessagePorts
- Subject: Re: Run Loops and CFMessagePorts
- From: Kurt Revis <email@hidden>
- Date: Tue, 28 Feb 2006 23:23:15 -0800
The simplest way I ever found to do this was:
In your main thread; 1) create a run loop source using CFRunLoopSourceCreate() 2) add it to the main run loop using CFRunLoopAddSource()
In your work thread, later on: 3) call CFRunLoopSourceSignal(runLoopSource) to touch the run loop source 4) call CFRunLoopWakeUp(mainThreadRunLoop) to make the run loop wake up soon -- otherwise it may take a few seconds
This will cause the run loop source's callback to get called in the main thread.
Working code to do this is in MessageQueue.c in SnoizeMIDI, available here:
I get the impression that, under the hood, the above process is doing basically the same thing as the CFMessagePort/NSPort stuff that you linked to below.
On Feb 28, 2006, at 12:51 PM, Wayne Anderson wrote: BTW, I really don't need to send data in this case. Just a simple signal to the application run loop will do. I'm following the sample code in...
|
_______________________________________________
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