viewer threading model must be single-threaded when using ImGui?

classic Classic list List threaded Threaded
6 messages Options
2LR 2LR
Reply | Threaded
Open this post in threaded view
|

viewer threading model must be single-threaded when using ImGui?

Can someone explain to me why the osgViewer threading model must be single-threaded when using ImGui in osgEarth?

Is there a way to work around this limitation to get the best performance possible? Our application drops about 10fps when we have to set the osgViewer threading model to be single-threaded...

Thanks.

Shayne
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: viewer threading model must be single-threaded when using ImGui?

I'm not sure it does. That was in there early as we were experimenting. It might work fine with a multithreading model, give it a try and report back.
Glenn Waldron / Pelican Mapping
2LR 2LR
Reply | Threaded
Open this post in threaded view
|

Re: viewer threading model must be single-threaded when using ImGui?

Glenn,

I tried with

viewer.setThreadingModel(viewer.suggestBestThreadingModel());

and osgEarth hangs when we open the "Terrain" tool in ImGui. The hang is intermittent.

When we open the "SceneGraph Inspector" and go to Scene->(class osg::Group)->(class osg::Group)->(class osg::SimpleSky::SimpleSkyNode)->osgEarth::MapNode (class osgearth::MapNode), I get a crash.

If I change back to

viewer.setThreadingModel(viewer.singleThreaded);

then both of the above ImGui tools run fine without any problems.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: viewer threading model must be single-threaded when using ImGui?

OK, thanks for investigating.
Feel free to enter a github issue ticket for any of these things you find (one per thing) just so it's on the radar.

I am a bit surprised that your app slows down considerably in single-threaded mode. It would be interesting to figure out exactly why that is. We generally don't see significant changes in perf with OE with different threading models unless there are many windows.
Glenn Waldron / Pelican Mapping
2LR 2LR
Reply | Threaded
Open this post in threaded view
|

Re: viewer threading model must be single-threaded when using ImGui?

Just a followup to this post...

Aside from the aforementioned problems, we do see a performance hit when loading our map data in our osgEarth app when the viewer threading model is single-threaded. We have a considerable amount of map data in the MBTILES format that we load in.

In single-threaded mode, it is slow paging in the data. When we change to DrawThreadPerContext on the threading model, the load is very fast.

Shayne
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: viewer threading model must be single-threaded when using ImGui?

Thanks for the additional info. We'll put a github issue in to track this further.

https://github.com/gwaldron/osgearth/issues/1756
Glenn Waldron / Pelican Mapping