Hi Daniel,

On 7/25/06, Daniel Larimer <[EMAIL PROTECTED]> wrote:
 I believe that the patch to Texture.cpp is a valid cross-platform fix
because it is accessing a static
buffered_value<ref_ptr<TextureExtensions> > while doing
multi-context rendering.
 The first time it attempts to render the texture in a new context it will
have to resize the internal std::vector based upon the new
 Context ID.   If you have many threads like my application does (7
independent contexts) then you have a race condition and it is
 inevitable that two threads will attempt to resize that static / global
std::vector at the same time.

The design of OSG is such that one should set up the maximum number of
graphics contexts before creating the scene graph, if you do this then
the osg::bufferd_value will never need to be resized so avoiding the
context issue.

The fact that you are coming against suggest that you haven't set the
maximum number of graphics contexts prior to creation of the scene
graph.

I realise this is an unsual caveat of multi-threaded multi-context
work, but this its a small hurdle which gains you much better
performance - otherwise you have mutex commonly access methods which
would kill performance.

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

Reply via email to