Robert,
That is effectively the 2nd line executed in main and I set num ==
10 for my application so I know that I haven't hit 10.
Upon closer inspection of include/osg/buffered_value I think I have
identified the REAL problem.
There is a difference between Linux and OS X when it comes to
allocating static variables. On OS X the static variables such as
s_extentions get allocated BEFORE main(), but Linux doesn't allocate
them until their first reference.
Further testing reveals that Drawable::getExtensions(),
Shader::flushDeleted...(), and several other places are still
crashing even with
my patch.
The solution to this problem is non-trivial and would require some
form of direct initialization of these values OR some way to set
DisplaySettings::instance()->getMaxNumberOfGraphicsContexts() before
main().
I put a print statement in the constructor of buffered_value to see
when it is initialized and to what size. I then put a print
statement at the first line in main(), here is the out put.
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
buffered_value size: 1
[thread: (?)] [CoveAppInit.cpp:27 in CoveAppInit] Initializing static
Cove objects...
[thread: (?)] [AutoreleasePool.cpp:143 in init] Created static
AutoreleasePool stack.
[thread: (?)] [AutoreleasePool.cpp:29 in AutoreleasePool] Created new
AutoreleasePool at address 0xa422e30.
[thread: (?)] [CoveAppInit.cpp:34 in CoveAppInit] Finished
initializing static Cove objects.
[thread: (?)] [cove.cpp:15 in main] main
Ideas?
Dan
On Jul 25, 2006, at 2:36 PM, Robert Osfield wrote:
On 7/25/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
I realise this is an unsual caveat of multi-threaded multi-context
work, but this its a small hurdle which gains you much better
performance - otherwise you have mutex commonly access methods which
would kill performance.
I forgot to mention the magic line is:
osg::DisplaySettings::instance()->setMaxNumberOfGraphicsContexts(num)
osgProducer::OsgCameraGroup sets atomatically this for you in its
constructor, so as long as you construct it before loading the scene
graph then everything is fine.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/