[osg-users] Is text thread safe in 2.0.0?

sherman wilcox wilcox.sherman at gmail.com
Sat Sep 1 13:06:37 PDT 2007


If I run with --mt 1 it runs for a bit....however if I change that to --mt
10 it crashes immediately. Tried this on an old dual-proc and a new
quad-core system. Here's the stack from the quad-core:

> osgText.dll!osgText::Text::Text()  Line 61 + 0x5 bytes C++
  osgtest.exe!UpdateTextOperation::load()  Line 556 + 0x24 bytes C++
  osgtest.exe!UpdateTextOperation::operator()(osg::Object *
callingObject=0x00000000)  Line 498 + 0x5 bytes C++
  osg.dll!osg::OperationThread::run()  Line 416 C++
  OpenThreads.dll!OpenThreads::ThreadPrivateActions::StartThread(void *
data=0x00f7cda8)  Line 120 C++
  msvcr80.dll!__endthreadex()  + 0x3b bytes
  msvcr80.dll!__endthreadex()  + 0xc7 bytes
  kernel32.dll!@BaseThreadInitThunk at 12()  + 0xe bytes
  ntdll.dll!__RtlUserThreadStart at 8()  + 0x23 bytes

I'm grabbed a copy out of SVN about 30 minutes after you posted. So, I
believe I have the right code. If you want me to perform any further
testing/changes just yell.


On 9/1/07, Robert Osfield <robert.osfield at gmail.com> wrote:
>
> On 8/31/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> > Now I do need qualify "pretty solid", its solid if I just leave the
> > osgtext --mt to do its stuff, but if I enable stats by pressing 's' I
> > getting freetype warnings printed out to the console and sometimes get
> > gargabe text on the stats.  Since the mutexes I've added were per
> > Font, I suspect that perhaps freetype can't handle separate threads
> > using different fonts at the same time - it can only handle single
> > threaded access.  This is my suspicion, one I haven't tested yet.
> > I'll do this another day though, its late in day and my RSI is biting.
>
> I have just changed the Font mutex I added yesterday to a static Font
> mutex that is shared between all Font's.  This change ensures the
> serialization of calls to freetype and clears the remaining problem of
> enabling stats while running osgtext --mt.  This change in now checked
> in.
>
> Could user check out the svn version of the OSG and test out the
> changes to osgText and let me know how you get on.
>
> 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/20070901/4eea70d2/attachment-0003.htm>


More information about the osg-users mailing list