Hi Andi,

It all depends upon the threading model you use with the Viewer. If you run
SingleThreaded then you can modify the scene graph in your PostDrawCallback
without worry as there will only be one thread working on the main scene
graph.  If you use DrawThreadPerContext which is the default, then
potentially you have the draw thread still running while the next thread
has already begun.  If you use CullDrawThreadPerContext then the next frame
won't start till all the the cull/draw threads are complete, but
potentially you could have multiple threads running if you have multiple
graphics contexts.

Using PostDrawCallback or FinalDrawCallback will not make a difference
w.r.t thread safety as both are called from the draw thread, just slightly
different points in the draw thread.

What you do need to make sure is that threads aren't trying to read/write
to the scene graph nodes at one time.  The easiest way is to just update
nodes in the main thread as part of the update phase, or just set the
threading model to one that avoids overlap.

Cheers,
Robert.

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BXsWP9%3D6bVPRKOfjgxt89YmcL%2B-GRSzPZCL6%2BZN0Gbq9g%40mail.gmail.com.

Reply via email to