[osg-users] Switch call to viewer::frame() between threads

Robert Osfield robert.osfield at gmail.com
Tue Sep 11 08:42:51 PDT 2018


Hi Steven,

I haven't heard of anyone trying to call frame from multiple threads
before, and personally wouldn't recommend doing it.  I have said why
you are wanting to do this so can't judge how sensible or daft it is.

If you want an application that has multiple threads that modifying
something and then want the scene graph to be rendered to show it then
I'd suggest that you have a viewer frame loop with frame barrier that
the various thread share and release when they want the frame to
render, then have a dedicated thread (possibly the main application
thread for simplicity) that then sits of this barrier waiting to be
released.

You'd still need to be really careful about modifying data in a thread safe way.

Robert.


More information about the osg-users mailing list