Hi Thierry,

Ahhh,,,  yep I get the issue now, the affinity code that is intended
to separate the threads based on the assumption that it's the main
application running on the machine, which normally is how vis-sim
applications are run, but in multiple parallel OSG applications it
forces the processes to sit on the same cores which is not good.

In your usage model switching off the setting of affinity might be one
thing to try, unfortunately you'll need to modify the VierwerBase.cpp
code to do this. Change:

bool affinity = numProcessors>1;

To

bool affinity = false;//numProcessors>1;

A better solution would be to have thread affinity configuration built
into osgViewer to allow you to specific which threads go where. This
is something I've considered in the past but haven't had the time to
tackle it.

Robert.



On 17 April 2014 17:33, Thierry Pébayle <peba...@unistra.fr> wrote:
> Hi Robert,
>
> thanks very much for your answer.
>
> I have updated OpenThreads lib (3.2.0->3.3.0) but it does not help much.
>
> In fact I think that OSG works well but not like I espect it to work...
>
> Let me explain:
>
> I run my application twice (once in each X server) in parallel.
> So there is just one camera per application, then first draw thread works 
> with cpu 1 and second draw thread (that is in fact also first draw thread for 
> the second application) works also with cpu 1 !
>
> I think that's a normal behaviour for OSG, (example with drawThreadPerContext 
> model)
> because first cpu number is initialized to 1 in this loop:
> ViewerBase.cpp line 381...
>
>
> Code:
>   unsigned int processNum = 1;
>     for(citr = contexts.begin();
>         citr != contexts.end();
>         ++citr, ++processNum)
>     {
>        ...gc->getGraphicsThread()->setProcessorAffinity(processNum %  
> numProcessors);
>        ...
>      }
>
>
>
> Perhaps I could get a pointer on draw thread with "viewer::getAllThreads" and 
> force draw thread cpu affinity...
>
> Cheers,
> Thierry
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59036#59036
>
>
>
>
>
> _______________________________________________
> 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