Re: Carbon -> Cocoa
Re: Carbon -> Cocoa
- Subject: Re: Carbon -> Cocoa
- From: Jens Alfke <email@hidden>
- Date: Wed, 22 Aug 2018 09:53:31 -0700
> On Aug 21, 2018, at 8:33 AM, Alastair Houghton <email@hidden>
> wrote:
>
> So, for instance, it’s not so good on macOS or iOS if its event dispatcher is
> based on select(), (e)poll() or kqueue() because what you really want on
> macOS/iOS is for the event dispatch to go via CFRunLoop; if it doesn’t,
> you’ll end up having to use threading to run the network library’s event
> loops on background threads, which for an async networking library kind of
> defeats the point IMO.
It does mean you have to spin up one background thread to sit and wait for
events; but that's not a big hardship. You still get the scalability benefits
of event-driven I/O, vs. having to use one thread per socket the old-fashioned
way.
(NSURLSession and Network.framework are doing the same thing under the hood,
after all.)
—Jens
_______________________________________________
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