Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Migrate iOS and OS X from libuv to GCD #3434

Closed
1ec5 opened this issue Jan 5, 2016 · 8 comments
Closed

Migrate iOS and OS X from libuv to GCD #3434

1ec5 opened this issue Jan 5, 2016 · 8 comments
Assignees
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS refactor

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jan 5, 2016

We should move the iOS and OS X SDKs from libuv to GCD. We’ll need to reimplement mbgl::util::RunLoop, mbgl::util::Timer, and mbgl::util::AsyncTask.

/cc @tmpsantos

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS refactor macOS Mapbox Maps SDK for macOS labels Jan 5, 2016
@1ec5 1ec5 self-assigned this Jan 5, 2016
@tmpsantos
Copy link
Contributor

Any volunteer to do something similar for Android? /cc @zugaldia @bleege

@mb12
Copy link

mb12 commented Jan 5, 2016

This will be a high impact project for Android in terms of increasing reliability across a range of devices since it would allow MapView to be implemented as a GLSurfaceView and get rid of all the calls to eglCreateContext, eglSwapBuffers etc. Please refer to the following issue for more details.

#1662

Given the high impact, it makes more sense to do this project for Android first instead of iOS.

@zugaldia
Copy link
Member

zugaldia commented Jan 5, 2016

Corresponding Android effort ticketed: #3440

@1ec5
Copy link
Contributor Author

1ec5 commented Jan 5, 2016

Some additional context in #3139 and #2909 (comment).

@tmpsantos
Copy link
Contributor

As a reference, this is how it was done for Qt: f5cb832

Note that on the RunLoop, RunLoop::addWatch and RunLoop::removeWatch is only needed if you want to support libcurl as network backend.

@jfirebaugh
Copy link
Contributor

I think CFRunLoop or NSRunLoop is going to be a better fit than GCD for how mbgl's RunLoop and Thread are currently structured.

@1ec5 Do you know particular reasons whether CFRunLoop or NSRunLoop should be preferred over the other for mbgl?

@jfirebaugh jfirebaugh assigned jfirebaugh and unassigned 1ec5 Feb 15, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Feb 15, 2016

At a quick glance, the biggest difference between the two is that CFRunLoop is a C API that follows Core Foundation / Carbon memory management conventions, while NSRunLoop is an Objective-C API that follows Cocoa conventions. Since we’re able to write the adapter in Objective-C++, either would technically work. Much like the CFURL / NSURL choice, I’m guessing it comes down to configurability versus elegance.

@jfirebaugh
Copy link
Contributor

This is now included in #2909.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS refactor
Projects
None yet
Development

No branches or pull requests

5 participants