<div dir="ltr"><div dir="ltr">Hi Anna & Glenm,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Jan 2020 at 13:00, OpenSceneGraph Users <<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I too have seen thread-related issues when creating Text from multiple threads. I was never able to find the time to debug it to conclusion; but I suspect that a shared Font object that needs to create new Glyph textures isn't doing so in a thread-safe manner. For example, Font::assignGlyphToGlyphTexture() modifies some structures without Mutex protection. Just something to check.<br></div></blockquote><div><br></div><div>Thanks for the suggestion.  I've done a code review of the Glyph/GlyphTexture/Font code and have added a mutex lock to the Font::assignGlyphToGlyphTexture().  There are already mutex locks elsewhere, but there may be a need to add more.  The change is checked into the 3.6 branch and master:<br></div><div><br></div><div>    <a href="https://github.com/openscenegraph/OpenSceneGraph/commit/2e0472ba7e05e680a9a7e0bc7676d4e5a12eefa5">https://github.com/openscenegraph/OpenSceneGraph/commit/2e0472ba7e05e680a9a7e0bc7676d4e5a12eefa5</a></div><div><br></div><div>I have tested by running all the OSG examples and running osgtext --mt, and don't see any regressions.  I can't confirm that the change has fixed the crashes that you both have seen as I haven't got any example that reproduces it.  Could you test the 3.6 branch and let me know how you get on.  <br></div><div><br></div><div>This fix isn't in 3.6.5-rc3. but will be part of the final 3.6.5 stable release.</div><div><br></div><div>Cheers,<br></div><div>Robert.<br></div><div><br></div><div> </div></div></div>