Hi Mike,

On 4/11/07, Mike Wittman <[EMAIL PROTECTED]> wrote:
1. OpenGL objects must be deleted by the (render) thread associated with
their context.  This is completely handled internally by OSG.

Yes this is correct.

2. OSG objects must be deleted in the main thread.

Objects can actually be deleted at any time in any thread as long as
no other thread is still using that objects.  ref_ptr<> does protect
against deleting objects that are being used, but only does so if the
code use them.  The rendering backend doesn't use ref_ptr<> in all
places for efficiency reasons, which is why in DrawThreadPerContext
the DeleteHandler caches deletes to prevent the update thread deleting
objects still being read by the drawing thread.

However, in general one can assume that ref_ptr<>'s thread safe
ref/unref will handle things just fine.

Robert.
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to