Hi,
I've run into the same issue:
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/52734
I think it might be worthwhile to add the affinity clear code to the
OpenThreads lib.
regards
jp
On 05/11/10 12:00, Anders Backman wrote:
Using OSG 2.8.3 under windows 7 64bit. VS2008.
Hi, we discovered a problem where OSG hijacks the affinity for threading
in void ViewerBase::setUpThreading():
ViewerBase.cpp:
// we'll set processor affinity here to help single
threaded apps
// with multiple processor cores, and using the database pager.
int numProcessors = OpenThreads::GetNumberOfProcessors();
bool affinity = numProcessors>1;
if (affinity)
{
OpenThreads::SetProcessorAffinityOfCurrentThread(0);
This means that, IF osg viewer is initialized before an app want to
setup threads, any threads started after that will get affinity(0), that
is stick to one core.
viewer.setupViewer( osg::Viewer::SingleThreaded );
createMyOwnThreads(); // sticks to CPU0.
Just because osg want to run on one thread, does not automatically mean
that all other API:s want to stick to that main CPU.
Any threads that should run on other CPU:s needs to be created BEFORE
osg::viewer is initialized, not always the case.
Assume a thread is created from the keypress of a user?
What we do now is to reset the threadmask after setupViewer is called.
Then we get all the core-usage we want :-)
Just wanted to share the experience.
Keep up the excellent work!
/Anders
--
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org