# Multithreaded graphics

**URL:** <https://root-forum.cern.ch/t/multithreaded-graphics/56127>\
**Category:** ROOT\
**Created:** [August 24, 2023, 3:32am UTC](https://root-forum.cern.ch/t/multithreaded-graphics/56127 "2023-08-24T03:32:55Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 25, 2023, 2:50pm UTC](https://root-forum.cern.ch/t/multithreaded-graphics/56127/10 "2023-08-25T14:50:26Z")

</div>

You could create a class derived from TCanvas, such as:

```auto
class MyCanvas : public TCanvas {
MyCanvas(args) : TCanvas(args) {}
UpdateHistogram(h) { Lockguard...};
TMutex fGuiMutex{};
}

```

Another option is to derive from TGMainFrame and then have a private member with a TRootEmbeddedCanvas. See full example here: [Oscilloscope class for binary waveforms 16-bit - #3 by ferhue](https://root-forum.cern.ch/t/oscilloscope-class-for-binary-waveforms-16-bit/22103/3)  
But the first option is simpler.

---

_[View the full topic](https://root-forum.cern.ch/t/multithreaded-graphics/56127)._
