Hi,

I am experiencing some problems with the different threading modes, particular when starting an app or closing one or all windows of a viewer. For my testing I am using "osgcamera -2 cow.osg" with the several flags for the threading mode (-s, -g, -c, -d):

Here are my observations:

+ when in SingleThreaded mode I can close all windows, but the app did not terminate (_done is always false), I get some warnings in the console: "Warning: GraphicsWindow not realized, cannot do makeCurrent."

+ when in DrawThreadPerContext-mode I get a deadlock when closing one window.

Here are the stack-traces of the threads:

Thread 1:
#2 0x000b3f83 in OpenThreads::Thread::YieldCurrentThread at PThread.c++:876
#3    0x010a40e9 in osg::OperationsThread::cancel at GraphicsThread.cpp:126
#4 0x010a1254 in osg::GraphicsContext::setGraphicsThread at GraphicsContext.cpp:321
#5    0x010a2aea in osg::GraphicsContext::close at GraphicsContext.cpp:186
#6 0x204b1818 in osgViewer::GraphicsWindowCarbon::checkEvents at GraphicsWindowCarbon.cpp:1163
#7    0x204ab2b0 in osgViewer::Viewer::eventTraversal at Viewer.cpp:1777
#8    0x204af5eb in osgViewer::Viewer::frame at Viewer.cpp:1698
#9    0x000046f5 in main at osgcamera.cpp:326

Thread 2-7:
#2    0x000b4dd9 in OpenThreads::Mutex::lock at PThreadMutex.c++:122
#3 0x204bf096 in OpenThreads::ScopedLock<OpenThreads::Mutex>::ScopedLock at ScopedLock:31 #4 0x204dd1d4 in ViewerDoubleBufferedRenderingOperation::draw at Viewer.cpp:368 #5 0x204ddaa4 in ViewerDoubleBufferedRenderingOperation::operator() at Viewer.cpp:556 #6 0x010a19f6 in osg::GraphicsContext::runOperations at GraphicsContext.cpp:426
#7    0x204d55fc in ViewerRunOperations::operator() at Viewer.cpp:986
#8    0x010a445b in osg::OperationsThread::run at GraphicsThread.cpp:290
#9 0x000b51b0 in OpenThreads::ThreadPrivateActions::StartThread at PThread.c++:158

+when in CullThreadPerCameraDrawThreadPerContext-mode, all the windows are created but no rendering is visible, instead the app is locked:

Thread 1:
#2    0x000b4478 in OpenThreads::Barrier::block at PThreadBarrier.c++:182
#3 0x204aeb1f in osgViewer::Viewer::renderingTraversals at Viewer.cpp:2149
#4    0x204af60f in osgViewer::Viewer::frame at Viewer.cpp:1700
#5    0x000046f5 in main at osgcamera.cpp:326

Thread 2-7:
#0    0x90025027 in semaphore_wait_signal_trap
#1    0x90029014 in pthread_cond_wait
#2    0x000b4478 in OpenThreads::Barrier::block at PThreadBarrier.c++:182
#3 0x010a3d9e in osg::BarrierOperation::operator() at GraphicsThread.cpp:339
#4    0x010a445b in osg::OperationsThread::run at GraphicsThread.cpp:290
#5 0x000b51b0 in OpenThreads::ThreadPrivateActions::StartThread at PThread.c++:158
#6    0x90024987 in _pthread_body

Thread 8-12:
#2    0x000b4dd9 in OpenThreads::Mutex::lock at PThreadMutex.c++:122
#3 0x204bf096 in OpenThreads::ScopedLock<OpenThreads::Mutex>::ScopedLock at ScopedLock:31 #4 0x204dd1d4 in ViewerDoubleBufferedRenderingOperation::draw at Viewer.cpp:368 #5 0x204ddaa4 in ViewerDoubleBufferedRenderingOperation::operator() at Viewer.cpp:556 #6 0x010a19f6 in osg::GraphicsContext::runOperations at GraphicsContext.cpp:426
#7    0x204d55fc in ViewerRunOperations::operator() at Viewer.cpp:986
#8    0x010a445b in osg::OperationsThread::run at GraphicsThread.cpp:290
#9 0x000b51b0 in OpenThreads::ThreadPrivateActions::StartThread at PThread.c++:158
#10    0x90024987 in _pthread_body

+ when in CullDrawThreadPerContext-mode everything is ok.

I did check the GraphicsWindowCarbon-implementation aginst the others, but could not spot any differences when closing a window.

Does osgcamera work on other platforms when closing one or all rendering-windows? (For this I modified the dimensions and placement of the 6 windows, so I can click the close-box of the window)

I did my tests on a MacBookPro with a CoreDuo and a single display on Mac OS X 10.4.9

Stephan
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to