Hi Guy,

The commit that changes this was:

ommit bb84f1ea3c23625a645b9c2848202bca7c566efb
Author: Konstantin S. Matveyev <r...@zorro.ev>
Date:   Sat Jan 13 15:46:53 2018 +0300

    osgViewer::ViewerBase setThreadingModel func fix: should not start
threading, must only restart

Off the top of my head I only vaguely recall the motivation for the
change.  Have a look at the mailing list/forum archives and the commit
on github to see any discussions about this from early January,

Robert.

On Thu, 12 Jul 2018 at 16:21, Guy Volckaert <guy.volcka...@meggitt.com> wrote:
>
> Hi,
>
> When I try to cycle through the threading models by pressing the 'm' key 
> (when the ThreadingHandler is registered) the stats would indicates the 
> correct threading model, but the engine would remain in SingleThreaded. So I 
> started investigating the issue and I noticed that, with OSG v3.6.2, the 
> ViewerBase::setThreadingModel() changed compared with v3.4.0. Below is a 
> snipit of function:
>
>
> Code:
>
> void ViewerBase::setThreadingModel(ThreadingModel threadingModel)
> {
>     if (_threadingModel == threadingModel) return;
>
>     bool needSetUpThreading = _threadsRunning
>
>     if (_threadsRunning) stopThreading();
>
>     _threadingModel = threadingModel;
>
>     if (needSetUpThreading) setUpThreading();
> }
>
>
>
>
>
> If the current threading model is SingleThreaded then _threadsRunning will be 
> false which means that needSetUpThreading will also be false. Therefore, 
> setUpThreading() will never be called if we are in SingleThreaded.
>
> Rolling back the function to v3.4.0 seems to resolve the problem, but I'm not 
> sure if that will cause other issues. There's obviously a reason why it was 
> changed. I would like someone with more experience that I to way in. Below is 
> a snipit of the rolled-back function.
>
>
> Code:
>
> void ViewerBase::setThreadingModel(ThreadingModel threadingModel)
> {
>     if (_threadingModel == threadingModel) return;
>
>     if (_threadsRunning) stopThreading();
>
>     _threadingModel = threadingModel;
>
>     if (isRealized() && _threadingModel!=SingleThreaded) startThreading();
> }
>
>
>
>
> Regards,
>
> Guy
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74324#74324
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to