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.

This is what I do:


Code:
#ifdef LINUX
    int numCPU = sysconf( _SC_NPROCESSORS_ONLN ); //glibc fails 'all ones' cpu 
masks so we need this sysconf call
    cpu_set_t  mask;
    CPU_ZERO(&mask);
    for (int i = 0; i < numCPU ; i++)
    {
        CPU_SET(i, &mask);
        //qDebug("SETTING CPU %d",i);
    }
    int ret = sched_setaffinity(0, sizeof(mask), &mask); //override 
OpenSceneGraphs shitty CPU affinity stuff
    //qDebug("CPU COUNT: %d %d",CPU_COUNT(&mask),ret);

#endif



------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68702#68702





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to