-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offload transformations onto separate thread #304
Conversation
51e6b26
to
7cbe704
Compare
d5eeb93
to
6db3424
Compare
Fixes a number of memory errors and other issues. Some introduced with a rebase, but mostly from the transformation handler's implementation.
431d94a
to
e5d0d23
Compare
One thing that would be nice to add to this is that the index is built with the transformation. Another is that as the index is made available while it is only partially complete. Then the user could begin to browse more than just the first buffer's worth of the file. However it could require some more intrusive changes and this PR is already quite large. @liquidaty |
fbbbce8
to
86b7da6
Compare
This uses the transformation API to produce a filter file and makes some changes to the API to allow almost the same behavior that the feature had before. The behavior has changed because now executing filter repeatedly filters the previously filtered file instead of replacing the filter.
86b7da6
to
3f38d92
Compare
Agreed, in particular the first-- will merge this PR and then can make that a separate new one |
Instead of doing the entire transformation in the foreground, this does an
initial chunk of the transformation in the foreground then offloads the rest
onto a background thread.
When new data is written to the transformation file the background thread
signals that new data is available and the UI buffer is reloaded.
The effect is that the user can see the transformation happen. If the index
were also built incrementally as new data became available then they could
start browsing the partially transformed file. This would require some work on
the index which currently just gets started after the transformation is finished.
As with doing the index in a background thread, this introduces a number of(fixed)problems. The background threads rely on UI buffer to store the mutex and other
resources, but the background threads are detached from the main thread and the
UI buffer is deleted on the main thread. So the background threads can outlive
the UI buffer.
Probably the UI buffer should not own the mutex and threads should not be
created on an ad-hoc basis, but instead be part of a thread pool that executes
a work queue or some similar scheme. This is probably beyond the scope of this
PR, but worth noting.
TODO:
search, filter) from being carried out on the buffer while transformation is in progress