Is there a way to call rendering in other threads in vtk?

Similar to the signal and slot mechanism in qt, you can put functions in other threads into the event loop

Hello,

I experienced crashes when I accidentally called rendering from a thread different from the thread where the VTK objects resided. However, it is possible to avoid it by keeping track of the thread id. Well, without further details on what you’re attempting or code it’s hard to tell for sure.

best,

PC

The slot is executed in the same thread of the signal, so you likely need some other inter-thread commmunication mechanism to safely trigger rendering from multiple threads. One example is the classic producer-consumer model. Take a look here (multithreading - Inter thread communication in C++ - Stack Overflow) to have some ideas.

thank very much ,I temporarily completed my requirements through semaphores, locks, and timers.

1 Like