Threads vs AIS_Context

Good morning everyone,
I have this thread who is in charge to display and update multiple (custom) objects within an AIS_Context.
In the meanwhile the user might want to zoom/pan/rotate (using the mouse) the scene during the process.
I'm experiencing some (random) crashes when this is done and I fear that this is due to the fact that sometimes it is not allowed (and/or safe) to perform camera operations while and AIS_Object is displayed or redisplayed.
Am I right? Is there a way to synchronize multiple operations onto a View and/or an interactive context? Or, at least, is there a way to check if a camera operation is safe against possible (re)drawing operations? Or, the other way around, is there a way to check if a context is "busy" due to some view operation and thus a display or redisplay call is not safe at a given moment?
As usual many thanks for your hints.


Kirill Gavrilov's picture

After and during displaying of AIS_InteractiveObject within AIS_InteractiveContext, object becomes a part of the scene content managed by interactive context (bound to V3d_Viewer / V3d_View). Therefore, it is not OK modifying AIS_InteractiveObject and redrawing Viewer in parallel threads without appropriate synchronization tools at application level - this will certainly lead to data races.

Gianluca Antoniacci's picture

Hello Kirill,
I'll work on it, then.
Many thanks for your feedback and for confirming my first thought.