[osg-users] SingleThreaded leading to whole application just running on one core

Fabian Wiesel fabian.wiesel at gmail.com
Sun Sep 25 14:52:55 PDT 2016

Hi Robert,

> Have you tried setting the affinity of the threads that are created?
> Have you tried creating the threads before the call to viewer.realize()?

Yes, both cause the threads being distributed across the cores. That is
probably also why initialising TBB early in main helps, as it creates a
pool of worker threads. For my app, you can consider it solved.
But don't you see a difficulty for OSG, if you cannot use any threading
library without additonal setup code?

> The way things are behaving looks to be down to the way that the Linux
threading is forcing the inheritance of the threading affinity of the main
thread to child threads.
> I don't know if there is an setting on the Linux threads side that can
change this behaviour so it's more consistent with other platforms.

I was looking for that, and my search was fruitless.
It also seems not to be Linux specific. FreeBSD seems to do the the same,
as is Windows:
> Process affinity is inherited by any child process or newly instantiated
local process

It looks more like OS X is the isolated case (and qnx).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160925/50572a4e/attachment-0003.htm>

More information about the osg-users mailing list