Hi Robert,

Ah, OK.  I was confusing the render thread with the main thread which
led me to confuse OpenGL and OSG object deletion constraints.  I guess
too much single-threaded, single-pipe graphics development makes the
mind go soft. :)

To summarize then, there are two distinct constraints with regard to
deletion of objects:

1. OpenGL objects must be deleted by the (render) thread associated with
their context.  This is completely handled internally by OSG.

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


Assuming this is correct, can you explain the source of the OSG object
deletion constraint?  It was my understanding that the thread-safe
reference counting support was intended to permit objects to be
referenced (and implicitly deleted) among multiple threads.

-Mike


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:osg-users-
> [EMAIL PROTECTED] On Behalf Of Robert Osfield
> Sent: Wednesday, April 11, 2007 10:36 AM
> To: osg users
> Subject: Re: [osg-users] Threading and object deletion
> 
> Hi Mike,
> 
> On 4/11/07, Mike Wittman <[EMAIL PROTECTED]> wrote:
> > It's possible to do explicit synchronous deletions via C#, so if
there
> > is a small number of classes/situations that require deletion via
the
> > render thread I think it would be better and cleaner to have the
user
> > take on this responsibility.
> 
> There isn't anything that gets significant deleted in the rendering
> thread, what will be allocated and deleted here will be temporary data
> used internally by the rendering backend.  Most scene graph elements
> will get created and deleted in the main thread, the threading models
> that the OSG support require this.
> 
> > Given what you wrote below would it be correct to say that, under
normal
> > osgViewer usage, ensuring the viewer object is deleted in the render
> > thread is sufficient to ensure all the OpenGL objects are deleted in
the
> > render thread?
> 
> The requirement to delete OpenGL objects from the rendering thread is
> not an OSG requirement but an OpenGL one, the osgViewer manage this
> for you any way so the app developer doesn't need to worry about it.
> The OpenGL objects are all created by the driver on the OpenGL side so
> arn't something that C# will worry about so I think things should be
> pretty straightforward.
> 
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to