[osg-users] Processor Affinity and forked processes

Robert Osfield robert.osfield at gmail.com
Sun Nov 29 11:29:24 PST 2015


Hi Pete,

Lots of OSG applications will use multi-threading, use database paging etc,
the OSG has lots of support for this directly in the core.

You can customize the OSG behaviour by overriding the way the threads are
set up just by subclassing from osgViewer::Viewer/ViewerBase an override
the setThreadingModel/setUpThreading() methods.  This is not what I
normally expect users to need to do, but in your instance you aren't an
ordinary user, as a power user subclassing from OSG classes is quite common
- the OSG's strength is that it's pretty extensible.

Robert.

On 29 November 2015 at 18:41, Pete Black <pete at marchingcubes.com> wrote:

> Hi Robert,
>
> I want to unset the CPU affinity that OSG hardcodes. Currently I achieve
> this under Linux with sched_set_affinity calls. But this requires
> platform-specific defines in my code, and just seems ugly.
>
> I have no idea why you would consider applications doing their own
> threading to be 'niche'. Doesn't every non-trivial application that deals
> with any kind of streaming data (terrain, video) need to multithread this
> in order to get acceptable performance where the main thread is blocked by
> vsynced OpenGL?
>
> Personally my application uses polyvox to continuously update a voxel
> terrain (it is a basic simulation of a coral reef), run the bullet physics
> engine on thousands of objects (fish), decode/cache videos using ffmpeg
> (for informational elements and animated skyboxes), pull frames from a
> webcam attached to the system and run OpenCV image analysis on them for
> gesture recognition.
>
> I guess I just do not expect my libraries to be silently making decisions
> about which CPUs to use, especially when it is done in such an invasive
> way, with no API provided to 'undo' it.
>
> - Pete
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65789#65789
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151129/0ccc8642/attachment-0003.htm>


More information about the osg-users mailing list