I think you need to be careful not to make any major changes to the scene graph 
during the cull/draw cycle.  If you can queue up changes from thread 2, so that 
thread 1 (the thread with sync, update and frame) processes all of them between 
calls to sync and frame, you'll be safe.  The update callbacks that can be 
attached to nodes work this way.  In the past, I've implemented a mutex 
controlled queue that gets populated with update callbacks by external threads 
and gets processed/cleared during the update phase of the thread 1.

Chase


-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Emmanuel Roche
Sent: Thu 4/5/2007 2:34 AM
To: OSG Users
Subject: [osg-users] osgUtil::SceneView cull() and draw() "separated"
 
Hello again,

I have another question concerning multithreading issues:

for example, is it possible to :

1) lock a scene graph in thread 1
2) perform cull() with a sceneView
3) unlock the graph

4) lock the graph in thread 2
5) modify somthing (could be anything: a nodemask, an osgText::Text color,
an attitude, etc...)
6) unlock the graph

7) lock the graph again in thread 1
8) perform draw() with the previous sceneView
9) unlock the graph


... this is the whole story of my life in fact... So any explanation on why
this is safe or unsafe would be really helpful :-)


regards,
Emmanuel.

<<winmail.dat>>

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to