loading multiple VRML files in parallel. Christopher R. Baker has
detected this bug and crafted a patch. In addition, libcoin has to be
also built with the "--enable-threadsafe" option.
I copy here his report, extracted from
(https://bugs.launchpad.net/ubuntu/+source/openscenegraph/+bug/1211993)
and attach his fix. All credit is due to him:
«
There are three instances of a classical method-local-static
multithreaded initialization bug in the Inventor plugin for OSG that
trigger various memory faults when reading multiple VRML files in
parallel via osgDB::readNodeFile. These bugs are of the form:
static std::map<Stuff,OtherStuff> myHandyMap;
static bool once = true;
if(once) { ...fill myHandyMap; once = false }
... use myHandyMap;
To repeat: try loading multiple VRML files from multiple threads. The
liklihood of the bug depends on many factors, but my application, which
parallel-loads some dozens of small (<100K) VRML files on startup,
triggers this problem 25% of the time or more.
The attached patch (inventor-plugin-multithread.patch) rectifies this
problem by:
1 - Inheriting MyHandyMap from std::map, then
2 - Moving the map initialization into the derived constructor, which
3 - Is intrinsically protected from multithread issues by g++ (and is
part of the C++ standard), unless you pass -fno-threadsafe-statics,
which is strongly discouraged by the man page.
»
"
The delay between the 2 types of messages is more noticeable on Windows 8 and leads to serious disruptions in our application.
Mouse messages generated by touch input are only present for legacy support. I think they should be filtered out by OSG (real click events originating from a physical mouse will of course still go through).
This is what this patch does, according to this suggestion: http://msdn.microsoft.com/en-us/library/dd693088%28v=VS.85%29.aspx (third issue in this page)."
In CMakeList.txt there is a case sensitivity issue which a fix was posted by Robert Osfield in the users forum.
I also had to rename the files OSXAvFoundationCoreVideoTexture.h and OSXAvFoundationCoreVideoTexture.cpp to OSXAVFoundationCoreVideoTexture.h and OSXAVFoundationCoreVideoTexture.cpp
Finally in OSXAvFoundationCoreVideoTexture.cpp the include OSXAVFoundationVideo.H was updated to OSXAVFoundationVideo.h"
I found a bug on DDS ReaderWriter that generates a false positive on a guard for the size check on writing operation. This is due to a wrong imageSize computation that uses img->getImageSizeInBytes() method instead of img->getTotalSizeInBytes(), that actually ignores the r() dimension, contrariwise taken into account by the function ComputeImageSizeInBytes() later.
The line 1062 on file ReaderWriterDDS.cpp should be fixed with:
[code]unsigned int imageSize = img->getTotalSizeInBytes();[/code]
"
available. But this just checks if the fbo functions can be called.
It doesn't check if the OpenGL renderer supports fbos. For indirect
rendering on linux the client side capability may be different from
the display server, which can lead to mipmapped textures failing to
render. I've added a fbo extension check.
"
1> osgmultiplemovies example does not use SDL so needs no link to SDL
2> Added header files to "Plugins osg" project, so visual studio can find the source of
OSG_WARN << "AsciiInputIterator::readProperty(): Unmatched property "
"
I've also checked the modified files still build ok with other
compilers (Linux gcc, Windows Visual Studio).
osgDB/OutputStream.cpp and osgPlugins/lws/SceneLoader.cpp require
stdlib.h for atoi use.
In osg/Uniform.cpp the compiler complains that base_class is unknown
unless I add a class name qualifier.
Not a build fix, but I spotted a typo in osgUtil/SceneView."