Hi Sukender,

On Thu, Jan 15, 2009 at 10:48 AM, Sukender <suky0...@free.fr> wrote:
> I like your idea. I'm not a threading expert, but won't this cost much? I 
> mean locking/unlocking is quite expensive, as far as I know, and depending on 
> the number of matrices to lock, this could cost much. Anyway much less that 
> waiting for a complete traversal to end, of course! :)
> Maybe our implementation could be a "ThreadSafeMatrixTransform"...

Perhaps a custom or user data callback would be sufficient for
managing the common data buffer, this way you could adapt the buffer
for different purposes.

As for the cost of the locking and unlocking - this is actually pretty
low, you don't want to be doing thousands of locks/unlocks per frame,
so if you do have a scene with many separate entities that are being
modelled then having composite buffers that have a single mutex
between them, and do a sync data to and from this buffer on batch
rather than each buffer individually would avoid making too many
lock/unlock calls.

As for the interpolation vs choosing the most value, this is something
that could easily be done via an option on the reading side - or
simply have two different update callbacks that read from the buffers
in different ways.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to