Re: Carbon -> Cocoa
Re: Carbon -> Cocoa
- Subject: Re: Carbon -> Cocoa
- From: Alastair Houghton <email@hidden>
- Date: Fri, 24 Aug 2018 20:16:59 +0100
On 24 Aug 2018, at 20:01, Tor Arne Vestbø <email@hidden> wrote:
>
> On 23 Aug 2018, at 12:06, Alastair Houghton <email@hidden>
> wrote:
>>
>> Run loops are based on dispatch queues too, these days.
>
> Are they? We use CFRunLoop in the Qt event dispatchers on macOS and iOS, and
> I these behave as normal sources without any sign of dispatch queues as far
> as I can tell?
>
> I did experiment with using dispatch sources instead, but these can not be
> recursed, which was a showstopper unfortunately. I would have loved to use
> the queue debugging feature (backtrace recording) to tie posted Qt events
> back to their origin.
You can see the code here
https://opensource.apple.com/source/CF/CF-1153.18/CFRunLoop.c.auto.html
<https://opensource.apple.com/source/CF/CF-1153.18/CFRunLoop.c.auto.html>
Perhaps “based on dispatch queues” is an exaggeration; it’s more that they’re
very tightly integrated… CFRunLoop appears to be using dispatch queues for
timers, and there’s clearly integration such that dispatched calls will run
within the run loop.
It does still have its own separate run loop sources, observers and so on, I
believe; they all talk to the run loop itself via a set of Mach ports.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden