Render from main thread rather than input plugin thread by default#19
Draft
Render from main thread rather than input plugin thread by default#19
Conversation
Motivation: - Some vis plugins turned out to not be prepared to receive window messages from multiple threads concurrently. - When then input plugin thread drives the vis plugin, visdriver has no control over vis plugin render rate. Assumptions: - Vis plugins want to present the latest data available. The second latest data may be better than no data, but the latest data should win over older data wherever possible, forwarding all data is not the goal. - Allowing to both read and write a block of vis data at the same time could make the vis plugin render inconsistent data, so that should be avoided. Access to each bucket's state needs to be atomic. - There is at most one reader (copying to the vis plugin) and at most one writer (copying from the input plugin) at any point in time. - If one of reader and writer are ever way slower than the other part, two buckets will not be enough. E.g. if bucket 0 is locked by the reader and the writer just finished writing to bucket 1 but hits again while the reader is still blocking bucket 1 the writer would then need to (a) not write the most recent data at all or (b) overwrite bucket 2 and force the reader to serve data from bucket 1 again that is less recent than ideal. - Use of pessimistic locking would not be ideal in the input plugin thread.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Assumptions: