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

Ravi Mathur ravidavi at utexas.edu
Tue Sep 11 09:02:22 PDT 2018

Hi Steven,

What OS are you on? On OSX, event handling MUST happen from the main
thread, so you have to coordinate the frame loop between threads.


On Tue, Sep 11, 2018 at 11:43 AM Robert Osfield <robert.osfield at gmail.com>

> 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.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180911/89884ec1/attachment.html>

More information about the osg-users mailing list