[osg-users] osg::Operation lags

Robert Osfield robert.osfield at gmail.com
Fri Mar 20 06:34:08 PDT 2009


Hi Roman,

You really need to learn how to investigate stuff on your own, I can provide
pointers of but it's down to you do learn stuff and to code stuff, you can't
expect others to walk you through it.   In the case of YieldCurrentThead
it's a single line of code that "Yields the Current Thread", so I can't see
what more needs explaining, there are plenty of examples of it in the core
OSG - just do a grep through the sources.

Robert.

2009/3/20 Roman Grigoriev <grigoriev at gosniias.ru>

>  Thanx Robert!
>
> Working with threads a little bit unfamiliar to me.
>
> Could you please point me to some examples how to use
> YieldCurrentThread()
>
> Thanx in advance
>
> Bye
>
>
>
> *From:* osg-users-bounces at lists.openscenegraph.org [mailto:
> osg-users-bounces at lists.openscenegraph.org] *On Behalf Of *Robert Osfield
> *Sent:* Friday, March 20, 2009 1:44 PM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] osg::Operation lags
>
>
>
> HI Roman,
>
> 2009/3/20 Roman Grigoriev <grigoriev at gosniias.ru>
>
> Hi Robert!
>
> As you’ve seen in my operation thread  I simply write to stdout simple
> message: "update" and nothing more.
>
> But framerate lags unpredictable.
>
> Maybe there is good example or readme how to use operationthread
>
> Thanx in advance
>
>
> I have never seen problems like yours when using OperationThread/Operatons,
> but on a second review I see that your OpenThread never sleeps, it just
> churns away as effectively a spin lock on the CPU. If your machine doesn't
> have sufficient cores to handle a thead using 100% of the CPU core then
> you'll get frame stalls like you have.
>
> Try sticking a OpenThreads::Thread::YieldCurrentThread() into your
> operation.
>
> Robert.
>
> _______________________________________________
> 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/20090320/69934bc1/attachment-0003.htm>


More information about the osg-users mailing list