Proposed alternative to WorkerThread #1014
Labels
Open for Discussion
There are several possibilites to address the issue and anyone is invited for comments.
WontDo
After we found out in #1001 that essentially, we see no way for proper synchronization of
WorkerThread
, here's an idea of how validation of the positional cache (i.e. whatDoValidateCache()
currently does) could be done in the main thread without blocking it too much and therefore get rid ofWorkerThread
and it's problems completely:The general idea is to validate the cache in smaller chunks and not in one go. Each chunk could be started by posting a window message and when the message is handled, a new message for the next chunk is posted again, but only if validation has not been cancelled.
That way the validation would not be blocking, so the tree does feel responsive. It avoids the fundamental problem of a thread walking the nodes even though the tree node structure is not thread-safe. A possible disadvantage is the necessity to have a window handle for posting the window messages, but as this originally was also done for
WorkerThread
, this doesn't seem like a big problem.This change could also have the potential to improve the following things:
This is definitely a non-trivial change and quite a bit work. Ideally before changing anything, a set of tests should be developed that the new implementation can be checked against.
The text was updated successfully, but these errors were encountered: