-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Disentangle the controller from threading and integrate the new logic into IncrementalMapperController #2392
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
Disentangle the controller from threading and integrate the new logic into IncrementalMapperController #2392
Conversation
|
Thanks, I am not sure how this helps with the next steps that you are envisioning and thus cannot formulate an opinion on these changes. For me to understand a little better: Would the existing "Thread" class still exist after these changes or simplify? |
|
With the new update just now the controller and threading is further disentangled by registering the callbacks of the controller in the thread class. Now the controller only supports the threading-functions as follows:
Note that now functions such as Also, @sarlinpe suggested to combine @ahojnnes About the next steps, Now the new design is only integrated in the |
|
The polymorphism with |
|
@B1ueber2y This design is much cleaner than the previous one. I think that we can move more threading logic out of the |
|
I have made a new design update on the ControllerThread class by directly inheriting from Thread. The only added feature is
In this design we wont deprecate the |
|
LGTM, great work, thanks a lot! |
|
Thanks, looks great. I assume you will follow up with equivalent changes for other controllers? |
Since we want to pybind substeps of the
IncrementalMapperControllerin python in the end, we need to disentangle the threading-related function from the controller class, such that we can further abstract the controller and manipulate the same thread in python.This DRAFT feature contains several updates as follows (need discussions on the naming and infrastructure. This PR is potentially dangerous):
BaseControllerclass that inherits from aCoreControllerclass, which supports all the previous features from the Thread class (https://github.com/B1ueber2y/colmap/blob/features/remove_thread_from_exe/src/colmap/util/threading_ctrl.h). While all the threading-related operations are set as callbacks with empty as default. When the threading is needed, one can useControllerThreadclass which uses a controller class as its template class and implements the callbacks in the constructor.Runfrom private into public (such that we can bind substeps later). Change the calling at top level fromStart()+Wait()into a singleRun()(e.g., https://github.com/colmap/colmap/pull/2392/files#diff-a075407d92533f0fe38542d18c5b0d9a8110138218e77a67deff2db3bb2811beR113). Only ui needs threading-related functions.BaseControllerand update the ui by usingControllerThread.If approved we can later change all the classes (now this draft PR only updates
IncrementalMapperControllerand the UI) into this new design by changing the parents of most controller fromThreadtoBaseController, and only useControllerThreadclass when threading-related functions are needed.@ahojnnes @sarlinpe