-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Python multiprocessing and Visualizer #389
Comments
This is doable but is a bit complicated. First, due to a limitation of glfw, the Second, make sure you understand how the rendering loop works. See comments in #343 and #357. In short, the rendering loop acts as:
This needs to be in the main thread. Finally, since you want to edit the geometry while rendering at the same time, there is indeed a race condition between editing and re-bind geometry. A lock needs to be introduced. A sample pseudo code is as follows:
There might be some issues though. And the main thread may get blocked a lot. I would still suggest to restructure the entire thing so that the worker thread can work in the main thread, and update the window once in a while. Something like:
|
@qianyizh, thanks for your help, and sorry for the late reply. This is what finally worked for me:
I tried making |
Also, it is probably worth mentioning somewhere in the docs that |
I want to have an application where I modify geometry in one thread and update the Visualizer in another thread. Is that possible?
I guess I am looking for a version of the non-blocking visualization example where the ICP runs in one thread and updates the geometry, while the visualizer updates are run in a separate thread.
Here is what I have so far:
It creates the two windows but they are blank and hang.
My idea was that once this works, I can externally modify the added geometry
g
and those changes should be automatically reflected in the visualization.The text was updated successfully, but these errors were encountered: