Re: using grand central dispatch with c++ for inter-thread communication
Re: using grand central dispatch with c++ for inter-thread communication
- Subject: Re: using grand central dispatch with c++ for inter-thread communication
- From: James Peach <email@hidden>
- Date: Wed, 21 Apr 2010 16:13:26 -0700
On 21 April 2010 12:57, Daniel A. Steffen <email@hidden> wrote:
> Hi Joel,
>
> On Apr 21, 2010, at 12:05 PM, Joel Reymont wrote:
>
>> I looked at using dispatch queues at first but got stuck. This may be just the opportunity to get me over the stumbling block! This is the crucial bit of code that I can't figure out how to translate to dispatch queues:
>>
>> static IONotificationPortRef __NotifyPort;
>>
>> // add notification port and run loop source for async notifications
>>
>> __NotifyPort = IONotificationPortCreate(masterPort);
>
>
>> runLoopSource = IONotificationPortGetRunLoopSource(__NotifyPort);
>> __MeasatRunLoop = CFRunLoopGetCurrent(),
>> CFRunLoopAddSource(__MeasatRunLoop, runLoopSource, kCFRunLoopDefaultMode);
>
>
> instead of these three lines instead, all that should be needed is
>
> IONotificationPortSetDispatchQueue(__NotifyPort, some_queue)
That's not a public API, see
<http://www.opensource.apple.com/source/IOKitUser/IOKitUser-514.8.1/IOKitLibPrivate.h>
--
James Peach | email@hidden
_______________________________________________
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