Dear all,
I'm using osg in an application running on Linux and Windows using Qt and
adapter widget.
I'm showing the relaxation process in a textile fabric and the number of
vertices can reach huge numbers. The scene (Geodes representing one yarn
thread each) has to be updated after each relaxation step.
The geodes are children of a switch node.
My first approach was creating all the new geodes in a first step and
replacing the old ones in a loop ofer the nodes by calling setChild(index,
newGeode). This worked fine on small scenes but failed on big scenes on 32 bit
machines because of the amount of data.
My second approach is getting pointers to the geodes, replacing their arrays
(vertices etc.) by newly created ones and filling them with new data. This way
crashes my application on some systems.
Both methods block updates by setting a mutex, create the new data in threads
and unlock the mutex after that.
Painting is done like that:
virtual void paintGL() {
if (!mutex.tryLock()) return;
frame();
mutex.unlock();
}
I'm sorry for the lengthy explanation. I have several questions regarding the
crashes:
- Is there any other activity in the data structures outside paintGL() ?
- Do I have to do anything to avoid access to cashed structures which might be
obsolete?
Thanks for any hint
- Werner -
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org