Commit 3ca12faf by cornimueller

[FIX] Added option in walnut.cfg to disable the multithreaded mode of the…

[FIX] Added option in walnut.cfg to disable the multithreaded mode of the CompositiveViewer. This fixes the occasional hanging when opening a new view (e.g. a EEG View), at least on my machine.
Standard is still multithreaded though.
Effects only the CompositveViewer, the other parts still run multithreaded.
parent 6da6453d
......@@ -21,3 +21,4 @@ default="Coordinate System Module,HUD,Navigation Slice Module"
# bgColor.g = .9 # background color (green part)
# bgColor.b = .9 # background color (blue part)
# zoomTrackballManipulator.allowThrow = yes # allow the auto-rotation thing when "throwing" an object with the mouse
# multiThreadedViewers = no # Use multiple threads for the multiple viewers. Causes hanging on some machines when opening a new view.
......@@ -39,6 +39,7 @@
#include "../common/WColor.h"
#include "../common/WLogger.h"
#include "../common/WPreferences.h"
#include "../math/WPosition.h"
#include "WGEViewer.h"
#include "WGraphicsEngine.h"
......@@ -65,14 +66,22 @@ WGraphicsEngine::WGraphicsEngine():
// ThreadingModel: enum with the following possibilities
//
// SingleThreadet
// SingleThreaded
// CullDrawThreadPerContext
// ThreadPerContext
// DrawThreadPerContext
// CullThreadPerCameraDrawThreadPerContext
// ThreadPerCamera
// AutomaticSelection
m_viewer->setThreadingModel( osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext );
bool multiThreadedViewers = true;
if( WPreferences::getPreference( "ge.multiThreadedViewers", &multiThreadedViewers ) && !multiThreadedViewers )
{
m_viewer->setThreadingModel( osgViewer::Viewer::SingleThreaded );
}
else
{
m_viewer->setThreadingModel( osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext );
}
// init resource manager ( it is a singleton and gets created during first "getResourceManager" request.
WGEResourceManager::getResourceManager();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment