Hi Robert,
Your example runs only as long as the viewer is living, but if you remove the 
viewer and add a new one, the CPU-affinity is lost (probably due to cloning). 
This was the reason, why the new callback in my submission had 2 methods: 
createDatabaseThread() and cloneDatabaseThread().

Sorry, for wasting your time, but I also spent hours or even days for this 
problem and waited about 1 year for resolution. I tested all your suggestions, 
but was not able so solve my problem. The solution now is a mix of your 
suggestions.

I think the submission is not complicated, only 2 files and only about 10 lines 
of code. Furthermore, the callback-technology is common in OSG. But this is my 
personally opinion, your opinion seem to be different.

Cheers
Alois



robertosfield wrote:
> Hi WeSee,
> 
> 
> You submissions was rejected as it added only complexity and add no useful 
> functionality.  I have never really understood why you were unable to set the 
> processor affinity, you never actually gave a working example to test so I 
> had to take on trust that you actually tried what I suggested, but it seems 
> you can't of.  To test things directly out myself I have just added a small 
> code segment to the osgterrain example that sets the processor affinity.  
> It's simple, straight forward as I suggested a long time ago:
> 
>     // add a viewport to the viewer and attach the scene graph.
>     viewer.setSceneData( rootnode.get() );
> 
>     // if required set the DatabaseThread affinity, note must call after 
> viewer.setSceneData() so that the osgViewer::Scene object is constructed with 
> it's DatabasePager.
>     if (setDatabaseThreadAffinity)
>     {
>         for (unsigned int i=0; 
> i<viewer.getDatabasePager()->getNumDatabaseThreads(); ++i)
>         {
>             osgDB::DatabasePager::DatabaseThread* thread = 
> viewer.getDatabasePager()->getDatabaseThread(i);
>             thread->setProcessorAffinity(cpuNum);
>             OSG_NOTICE<<"Settings affinity of DatabaseThread="<<thread<<" 
> isRunning()="<<thread->isRunning()<<" cpuNum="<<cpuNum<<std::endl;
>         }
>     }
> 
>     // run the viewers main loop
>     return viewer.run();
> 
> 
> I have just test on my system checking with the KDE System Monitor and each 
> time I run it with --db-affinity cpuNum option that sets the 
> setDatabaseThreadAffinity/cpuNum used above I see the appropriate processor 
> hit 100%.
> 
> 
> It works.  Could you please try this on your own system.
> 
> It's frustrating that you clearly never properly tried my suggestions or 
> tried to debug why they didn't work, instead we've been run around the houses 
> with your over complicated attempts to solve a problem that never existed.
> 
> Robert.
> 
>  ------------------
> Post generated by Mail2Forum


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





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

Reply via email to