Robert,

We are making modifications to the scene graph from the application/GUI
thread, and we create a "Graphics" thread that runs the frame() loop. We
also have our own mutex which we lock() while frame() is being called,
or while modifying the scene graph from the GUI thread. There are also
times that the Graphics thread will call some of the same functions that
lock() this mutex, via OSG Node Cull callbacks, camera final draw
callbacks, etc. As I said before, our CompositeViewer is set to
SINGLE_THREADED.

My question is, if I am not calling frame() and modifying the scene in
the GUI thread at the same time, is it necessary to call
stopThreading/startThreading?

John 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Thursday, June 26, 2008 6:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgViewer::CompositeViewer Thread Safety

Hi John,

Could you give a bit more context to when in the frame and what thread
you are doing operations from, without this info there is really no
chance to help you.

As a general not CompositeViewer and Viewer are identical when it comes
to threading - they even share the same code for doing the rendering and
threading.

Robert.

On Tue, Jun 24, 2008 at 4:07 PM, Argentieri, John-P63223
<[EMAIL PROTECTED]> wrote:
> Guys,
>
> Is it safe to modify the scene graph outside of frame() with 
> CompositeViewer with ThreadingModel SINGLE_THREADED, even if I don't
call stopThreading()?
>
> We are changing the node mask of certain elements during the root 
> node's cull callback. This turns certain draw elements on or off, but 
> more importantly it turns the textures mapped to those elements on or 
> off as well.
>
> The issue that I am seeing is that if I call stopThreading, the 
> textures mapped to the draw elements are not the ones that I assigned,

> but random ones that exist on other elements. This might be some kind 
> of display list corruption or something.
>
> One more question: If someone has seen this behavior before, is there 
> a way to set up the draw elements so that this issue does not occur 
> when I call stopThreading?
>
> I appreciate any input that you guys can provide that may help me on 
> this issue.
>
> Sincerely,
>
> John Argentieri
> Software Engineer
> GENERAL DYNAMICS
> C4 Systems
> [EMAIL PROTECTED]
>
> "This email message is for the sole use of the intended recipient(s) 
> and may contain GDC4S confidential or privileged information. Any 
> unauthorized review, use, disclosure or distribution is prohibited. If

> you are not an intended recipient, please contact the sender by reply 
> email and destroy all copies of the original message."
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to