On Tue, Jan 11, 2011 at 6:01 PM, Robert Osfield <[email protected]>wrote:

> Hi Tim,
>
> Thanks for the patch, now merged and submitted to svn/trunk.
>
> What configuration of the viewer + osgEarth did you seen the
> performance drop?  Was it a consistent performance drop?  Anything in
> particular that led you to suspect ThreadSafeQueue as problem?
>
It was a very simple osgEarth example: gdal_tiff.earth, which has a couple
of levels of images and geometry. The default threading mode on this 2
processor laptop is DrawThreadPerContext, and it was very noticeable that
the performance was 15 fps, as opposed to 60 fps in SingleThreaded mode. I
interrupted the program with gdb a few times and found the draw thread
waiting for a new SceneView, so I started looking at the queues. There is
something else lurking  out there: occasionally (about one time in 30) I see
the same slow down, but before this change it was very consistent. So, I can
convince myself that the change helps, but maybe it's an accident of thread
timing  and such that is giving the improvement. I wish I had better tools
for locating thread latency in Linux...

> I'm curious as the cause of the lack of multi-context scaling is
> rather perplexing right now so the more background knowledge about
> what type of things look to be problematic and why is useful.
>
I've found that the NVidia driver is taking a lock on every major call, such
as a texture bind, program application, etc. I don't know who is protecting
 what and if there is actual contention between draw threads.

I see that there is a race in OpenThreads::Block::set(). I haven't tried
fixing it yet to see if notifications are being dropped.

Tim

>
> Cheers,
> Robert.
>
> On Wed, Jan 5, 2011 at 10:42 PM, Tim Moore <[email protected]> wrote:
> > Hi,
> > This patch fixes a race condition in Renderer::ThreadSafeQueue that was
> > causing some notifications of available SceneView objects to be missed. I
> > saw a very noticeable performance problem (60 fps -> 8 fps) in
> > DrawThreadPerContext mode in an osgEarth application before this patch. I
> > had high hopes that this change might fix the much-discussed multiple GPU
> > problem; no such luck, but I think the root cause of that is probably a
> > similar threading issue.
> > Tim
> >
> > _______________________________________________
> > osg-submissions mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> >
> >
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to