Multitasking questions

I know that occ doesn't support yet full multithreading, but it is safe to write an application with two thread, one for the GUI (Qt, AIS_InteractiveContext, V3d_View, ...) and the other for the actual processing (it uses OCC but not Visualization classes)?

Roman Lygin's picture

Hi Marco,

Yes, this must be possible. I recall there was a Collision Detection demo application that was multi-threaded where computations were performed in a work thread while GUI still remained responsive and the user could rotate, zoom, pan the model.

You should set MMGT_REENTRANT variable to 1 or use Standard::SetReentrant(Standard_True) before your fork the threads.

By the way, note that Qt requires that the event loop (and hence all GUI) runs in a main thread.

Hope this helps.
--- - the Open CASCADE blog

Marco Matt's picture

Thanks, I'll try and let you know.