-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
First obstacle to flattening the inheritance hierarchy is that
These are all the types of things that I expect to migrate into |
Hmm, so the |
Right, TileWorker is an interim class. Once it's fully separable from the TileData hierarchy it should merge into Worker::Impl. Then we should probably rename Worker to TileWorker. |
} | ||
|
||
LiveTileData::~LiveTileData() { | ||
// Cancel in most derived class destructor so that worker tasks are joined before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments are very helpful. Any reason to remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My eventual plan was to have a flat hierarchy, with LiveTileData
not inheriting from VectorTileData
, so that (among other things) this would become moot. If we end up not doing that I'll add the comments back.
I'm currently working on moving the after callback / canceling semantics offered by This involves adding an additional template argument to
I need to use some kind of |
Why is this necessary? |
As you pointed out in #1471 (comment), it's probably not, and I agree. |
This branch is currently hanging on headless rendering tests. It has something to do with reparsing partial tiles, but the data flow there is really hard to follow. @tmpsantos do you think you could take a look at it? |
On it. |
@tmpsantos I would love the partial parsing to be refactored. I'm thinking we should create a list of all layers that need parsing when we start the parse step. In the parse thread, we iterate through that list, parse, then remove from that list when we've parsed a layer. This means that at some point, this list will be empty and we know that everything's been parsed. This is likely less error prone than using the total bucket count as a measure for whether we need to parse again. This also means that we can start removing the |
The long term goal is to split up parsing per layer so that we could ideally parse one vector tile with multiple threads. This requires making the task of parsing a layer from a tile independent of order and ideally has no concurrent access. This means we'd have to give every layer their own buffers and not do label placement until we actually have the label layers parsed. |
a1922a1
to
3339001
Compare
de0b0f4
to
0421a4e
Compare
…Data" This reverts commit 0444544.
As a byproduct, this makes FileCache get requests properly cancelable.
Also improved the error message and updated the test case.
Instead of transforming between return value and callback, pass the wrapped callback on to the invoked function as the last argument. This eliminates the need for multiple invokeWithArgument overloads and permits invoked functions to be asynchronous.
Cleanly separate two different kinds of data:
Tile
objectTileWorker
objectData will move between map thread and worker threads via the
Thread::invoke
message passing system. No tile data will be shared between the two. (For now we'll continue to share references toStyle
and atlases, but this is another step toward removing that sharing as well.)Targeted bugs:
Plan of attack:
TileData
inheritance hierarchy into a fully-abstract base class andRasterTileData
,VectorTileData
,LiveTileData
child classes. Note thatLiveTileData
will not inherit fromVectorTileData
. (This will introduce code duplication that will later be factored away.)TileWorker
class, move worker code fromTileData
to it. This may need to be a parallel inheritance hierarchy withRasterTileWorker
,VectorTileWorker
, andLiveTileWorker
. At first objects of this class will be owned byTileData
and descendants, but eventually they will live persistently on the worker thread.TileWorker
.Worker
. Assign a worker thread to a tile once, and then dispatch future work requests to the same worker thread, like in gl-js.TileWorker
to worker threads.There are many known unknowns here -- best way to learn them is to start working on this and see what we run into.