Yes Kenneth liked the Highland Park. Actually I like that too, even more
than Bowmare, especially the 16year HP!!, ok drifting from subject now...so:


When thread mask is set, all threads created from that thread will inherit
the thread mask.
So if setupViewer() is called from main, all other threads will be forced to
run on the same CPU.


This is the code we use for resetting under linux and Windows:


#ifdef __linux__
  cpu_set_t cpuset;
  pthread_t thread = pthread_self();

  int limit = std::min( 64, CPU_SETSIZE );

  CPU_ZERO(&cpuset);
  for (int j = 0; j < limit; j++)
    CPU_SET(j, &cpuset);

  if ( pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset) != 0 )
    LOGGER_WARNING() << "Could not set affinity mask" << std::endl <<
LOGGER_END();
#endif

#ifdef _MSC_VER
  HANDLE t = GetCurrentThread();
  SetThreadAffinityMask(t, 0xFFFF);
#endif


On Fri, Nov 5, 2010 at 2:43 PM, Jean-Sébastien Guay <
[email protected]> wrote:

> Hi Anders,
>
>
>  What we do now is to reset the threadmask after setupViewer is called.
>> Then we get all the core-usage we want :-)
>>
>
> Just curious, could you share the code you use to reset that? Also, since
> the code that sets the affinity is in ViewerBase::setUpThreading(), I guess
> each time an app does a stopThreading() and then startThreading(), it would
> need to be reset.
>
> We might be seeing something similar in our apps (at least I think it would
> explain something I was seeing) so thanks for sharing your findings!
>
> Thanks,
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    [email protected]
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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

Reply via email to