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

Christoph Weiss weiss at wsoptics.de
Fri Sep 23 00:44:23 PDT 2016


Hi Robert,

wouldn't it be a better approach to give the user the option to change 
such a setting for their application?

But thanks for pointing out the subclassing option, that's what I'll go 
for!  Still it took me half a day to track down what was going on.  (I 
didn't suspect OSG in the beginning at all, and since there are quite a 
few dependencies in our application, it took me considerable time to 
track it down.)  I think that's a sufficient reason to at least mention 
it in the documentation, better yet make it not default but optional 
behavior that the user can set?

Christoph

Mit freundlichen Grüßen,

Christoph Weiß

WSoptics GmbH
weiss at WSoptics.de
+49 8868 181 997 3
Zugspitzstraße 9
86972 Altenstadt

HRB 204558  Gerichtsstand: München B  Ust.Id.Nr.: DE289079930
Geschäftsführer: Florian Sepp, Dr. Christoph Weiß

On 09/23/2016 09:40 AM, Robert Osfield wrote:
> 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.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list