tangrams/tangram-es — pull request #16 by blair1618 (2014-10-30 20:58:03+00:00)
Title: Async tiles

This change mostly affects TileManager and DataSource and enables loading and building of map tiles in asynchronous threads, leaving the UI thread unblocked. Minor collateral changes were made to Style, VboMesh, and GeometryHandler to prevent race conditions when building tiles on concurrent threads. Tiles that are currently loading are represented by empty unique_ptrs in the tile set, so SceneDirector was changed to ignore these tiles in the draw loop.

Future work:

* Presently, all tile data is permanently cached; This behavior isn't super important right now since we plan to implement a more sophisticated caching scheme later, but we should be aware of it.

* Parallel tile creation is not throttled; It might be better to spawn a limited number of threads and/or network requests appropriate to the platform.

* Network requests have no error recovery (outside anything that might be built into libCurl); This is definitely worth more work since we plan to operate on mobile networks.