Hi Andreas,

I have just done a quick code review of ObjectWrapperManager and the lack
of a mutex lock on the management of the internal _wrappers and
_compressors looks likely to be the central problem in it's threadsafety -
in particular during the initial phase of registering of wrappers it looks
like race conditions are most likely.  I don't think just re-trying will
address these potential race conditions.

If you put together a solution that works please post it for discussion.  I
have other dev work to complete today so can't look into it right away.

BTW, what version of the OSG are you working on?

Robert.

On 14 October 2014 10:20, Andreas Roth <[email protected]> wrote:

> Hi,
>
> I came across an issue in the ObjectWrapper::findWrapper (trunk).
> - application starts, list of object wrappers is empty
> - two nodes are loaded simultaneously by two database pager threads
> - both nodes require the same object wrapper
> - one of the two threads loads the appropriate serializer which registers
> the needed object wrappers.
> - this thread checks the list of object wrappers again after the plugin
> was loaded.
> - these other thread (which gets PREVIOUSLY_LOADED) for the serializer
> plugin does not retry to find the requested object wrapper, but the wrapper
> was just loaded by the first thread.
> - The second thread returns with a load error because no object wrapper
> could be found.
>
> I propose the object wrapper retries to lookup the wrapper when a plugin
> was loaded or when the list of wrappers has changed.
>
> Cheers,
> Andreas
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=61293#61293
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to