{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2909","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2909/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2909/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2909/events","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/2909","id":114785360,"number":2909,"title":"Render on an arbitrary thread","user":{"login":"kkaefer","id":52399,"avatar_url":"https://avatars.githubusercontent.com/u/52399?v=3","gravatar_id":"","url":"https://api.github.com/users/kkaefer","html_url":"https://github.com/kkaefer","followers_url":"https://api.github.com/users/kkaefer/followers","following_url":"https://api.github.com/users/kkaefer/following{/other_user}","gists_url":"https://api.github.com/users/kkaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/kkaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkaefer/subscriptions","organizations_url":"https://api.github.com/users/kkaefer/orgs","repos_url":"https://api.github.com/users/kkaefer/repos","events_url":"https://api.github.com/users/kkaefer/events{/privacy}","received_events_url":"https://api.github.com/users/kkaefer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"jfirebaugh","id":98601,"avatar_url":"https://avatars.githubusercontent.com/u/98601?v=3","gravatar_id":"","url":"https://api.github.com/users/jfirebaugh","html_url":"https://github.com/jfirebaugh","followers_url":"https://api.github.com/users/jfirebaugh/followers","following_url":"https://api.github.com/users/jfirebaugh/following{/other_user}","gists_url":"https://api.github.com/users/jfirebaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/jfirebaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfirebaugh/subscriptions","organizations_url":"https://api.github.com/users/jfirebaugh/orgs","repos_url":"https://api.github.com/users/jfirebaugh/repos","events_url":"https://api.github.com/users/jfirebaugh/events{/privacy}","received_events_url":"https://api.github.com/users/jfirebaugh/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-11-03T10:30:48Z","updated_at":"2015-11-17T01:42:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/2909","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/2909","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/2909.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/2909.patch"},"body":"We're currently rendering on the MapContext thread. However, when triggering a render call from the main thread, we're also blocking the main thread, so there's no advantage from parallelization here, but we have the overhead of managing the OpenGL context on the MapContext thread. Instead, we should split up Mapbox GL into two parts: the MapContext thread manages the state of the objects, coordinates tile loading and style updates, the Painter thread (which can run either on the MapContext thread, the main thread, or an entirely different thread) that just takes the state the MapContext thread produces, and renders a frame."},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/157234117","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/2909#issuecomment-157234117","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2909","id":157234117,"user":{"login":"jfirebaugh","id":98601,"avatar_url":"https://avatars.githubusercontent.com/u/98601?v=3","gravatar_id":"","url":"https://api.github.com/users/jfirebaugh","html_url":"https://github.com/jfirebaugh","followers_url":"https://api.github.com/users/jfirebaugh/followers","following_url":"https://api.github.com/users/jfirebaugh/following{/other_user}","gists_url":"https://api.github.com/users/jfirebaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/jfirebaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfirebaugh/subscriptions","organizations_url":"https://api.github.com/users/jfirebaugh/orgs","repos_url":"https://api.github.com/users/jfirebaugh/repos","events_url":"https://api.github.com/users/jfirebaugh/events{/privacy}","received_events_url":"https://api.github.com/users/jfirebaugh/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T01:42:15Z","updated_at":"2015-11-17T01:42:15Z","body":"Next step here is to peel off the parts from `tmpsantos-libuv_abstracted` related to removing libuv dependencies from the FileSource thread. That's a bigger chunk of work, mainly due to the use of libuv IO functionality, that we don't need to bite off right now.\r\n\r\nThe model for `render-main` will be that the main thread uses the native event loop, with a `RunLoop` wrapper that isn't actually `run()` except for the GLFW app, and other threads use a libuv loop."}}