# Multithreaded rendering issue

**URL:** <https://forum.juce.com/t/multithreaded-rendering-issue/12501>\
**Category:** General JUCE discussion\
**Created:** [March 7, 2014, 8:47am UTC](https://forum.juce.com/t/multithreaded-rendering-issue/12501 "2014-03-07T08:47:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [March 7, 2014, 8:47am UTC](https://forum.juce.com/t/multithreaded-rendering-issue/12501/1 "2014-03-07T08:47:12Z")

</div>

Hi Jules, I have an application where upon loading a project, I try to render it on a background thread (i.e. using Graphics and rendering to Image objects), and when the component is done rendering, I add it to a GUI component for visualization.&nbsp;

This "almost" works. Somehow there are multithreading issues with the GlyphCache. See before and after (loading project) images attached to this post.

I've tried to "cache" font sizes I use in the software, but I still see this problem.

Ideas ?

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 8, 2014, 2:21pm UTC](https://forum.juce.com/t/multithreaded-rendering-issue/12501/2 "2014-03-08T14:21:43Z")

</div>

Hmm.. GlyphCache is using a lock and looks&nbsp;correct&nbsp;to me.. Have you got&nbsp;some test code that I could use to replicate this myself?

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [March 8, 2014, 4:41pm UTC](https://forum.juce.com/t/multithreaded-rendering-issue/12501/3 "2014-03-08T16:41:13Z")

</div>

Thanks Jules, but I've reproduced the problem in GUI thread only also, so it cannot be a problem with the GlyphCache. So something else is messing it up, and only in Release build. I hate these kinds of bugs...

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 8, 2014, 4:55pm UTC](https://forum.juce.com/t/multithreaded-rendering-issue/12501/4 "2014-03-08T16:55:24Z")

</div>

Would be happy to investigate, but would need to be able to replicate it somehow!
