[osg-users] Processor Affinity and forked processes

Pete Black pete at marchingcubes.com
Sun Nov 29 12:22:01 PST 2015


Hi Robert,

Its not like I can't solve my own problem (I already worked around it by overriding all OSGs CPU affinity setting with platform specific code) , but as demonstrated by the original poster in this thread, I am not the only one who has had to spend a lot of time wondering what is going on and debugging this behaviour, especially since I saw different behaviour on different platforms, with identical code, and version of OSG.

Even given that there are clear benefits to binding OSG threads to specific CPUs, that should be something actively chosen by the programmer, or selected with a specific threading model identifier e.g. 'SingleThreadedDBOptimised' or something like that.

I mean, the comment around that section:

// we'll set processor affinity here to help single threaded apps
// with multiple processor cores, and using the database pager.

Doesn't do what it says - it makes no attempt to check if the app is using the database pager, just blindly sets CPU affinity in every case that the Viewer is created with the 'SingleThreaded' option.

Clearly OSG has a large number of users who expect it to play nicely with other libraries (e.g. the popularity of Qt integration) - and this behaviour just seems out of step with that, and, in my view,  a massively premature optimisation for the majority of applications.

However, you also seem quite attached to this 'feature' so I'll shut up about it now, its really a small issue for me in the scheme of things, and I am just trying to save other users the frustration of dealing with this largely undocumented behaviour.

Thanks for all your work on OSG - it is a core part of my project and makes my life a lot easier.

-Pete


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








More information about the osg-users mailing list