[core] Use an actor model for tile worker concurrency

This commit is contained in:
John Firebaugh
2016-09-06 15:01:34 -07:00
parent 0bd66d40dd
commit 41bbd4e4f7
41 changed files with 1198 additions and 825 deletions

View File

@@ -22,6 +22,7 @@
#include <mbgl/util/async_task.hpp>
#include <mbgl/util/mapbox.hpp>
#include <mbgl/util/tile_coordinate.hpp>
#include <mbgl/actor/thread_pool.hpp>
namespace mbgl {
@@ -61,6 +62,7 @@ public:
gl::ObjectStore store;
Update updateFlags = Update::Nothing;
util::AsyncTask asyncUpdate;
ThreadPool workerThreadPool;
std::unique_ptr<AnnotationManager> annotationManager;
std::unique_ptr<Painter> painter;
@@ -99,6 +101,7 @@ Map::Impl::Impl(View& view_,
contextMode(contextMode_),
pixelRatio(view.getPixelRatio()),
asyncUpdate([this] { update(); }),
workerThreadPool(4),
annotationManager(std::make_unique<AnnotationManager>(pixelRatio)) {
}
@@ -227,9 +230,8 @@ void Map::Impl::update() {
style::UpdateParameters parameters(pixelRatio,
debugOptions,
transform.getState(),
style->workers,
workerThreadPool,
fileSource,
style->shouldReparsePartialTiles,
mode,
*annotationManager,
*style);