[osg-users] SingleThreaded leading to whole application just running on one core

Robert Osfield robert.osfield at gmail.com
Fri Sep 23 00:40:16 PDT 2016


On 23 September 2016 at 05:25, Pete Black <pete at marchingcubes.com> wrote:
> This is, bizarrely, by design.
>
> In single-threaded mode, OpenSceneGraph silently sets CPU affinity to a single core by default. Personally I think this is incredibly obtrusive on the programmer, and the reasons for this being default behaviour are terrible, but it is what it is.

Affinity is set by default because the it will provide the best
performance for majority of OSG applications.  This might be a
"terrible" reason for you, but the OSG development is motivated not by
just focusing on one class of users needs or preferences, default
settings we try to do the best for most OSG applications.

Please remember, The OSG is extensible, if you don't like default
behaviour in most cases you can adapt the it. In the case of threading
ViewerBase::setUpThreading() and startThreading() are both virtual and
as such are meant for the purpose of specializing them in subclasses
from ViewerBase i.e. Viewer+CompositeVIewer and for users then to
subclass from these if they wish.

Robert.



More information about the osg-users mailing list