Hi Robert,

the overall application is a pretty big system for rendering of massive 3D city 
models. We are creating several threads on our own, e.g. for service request, 
fetching of texture tiles etc. The viewer itself is not operating in a threaded 
mode. Some threads are also database pager threads created by OSG.

The version of OSG is the one tagged as 3.3.0 in the github repository. For me 
it seems like the following code from PThread.cpp causes the cpu affinity mask 
of the complete process to be set to CPU zero. After i found this piece of 
code, i switched openthreads to use QT threads. After recompilation, the cpu 
affinity of all process threads was set correctly to use all processors. 


Code:

        if (pd->cpunum>=0)
        {
#if defined(__sgi)
            pthread_setrunon_np( pd->cpunum );
#elif defined(HAVE_PTHREAD_SETAFFINITY_NP) || 
defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY) || 
defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
            cpu_set_t cpumask;
            CPU_ZERO( &cpumask );
            CPU_SET( pd->cpunum, &cpumask );

#if defined(HAVE_PTHREAD_SETAFFINITY_NP)
            pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);
#elif defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
            sched_setaffinity( 0, sizeof(cpumask), &cpumask );
#elif defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
            sched_setaffinity( 0, &cpumask );
#endif
#endif
        }




Kind regards,
Jan

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to