This macro demonstrate usage of ROOT7 graphics from many threads Three different canvases in three different threads are started and regularly updated.
Extra thread created in background and used to run http protocol, in/out websocket communications and process http requests Main application thread (CLING interactive session) remains fully functional
#include <thread>
#include <iostream>
{
for (
int n = 0;
n < 10000; ++
n) {
}
auto canvas = RCanvas::Create(title);
canvas->Draw(
pHist)->line.color = col;
canvas->Draw(
pHist2)->line.color = RColor::kBlue;
canvas->Show();
std::cout << title << " started" <<std::endl;
for (
int loop = 0; loop <
maxloop; ++loop) {
for (
int n = 0;
n < 10000; ++
n) {
}
canvas->Modified();
canvas->Update();
canvas->Run(0.2);
}
std::cout << title << " completed" <<std::endl;
canvas->Remove();
}
{
}
} else {
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Objects used to configure the different axis types.
static std::shared_ptr< RWebWindowsManager > & Instance()
Returns default window manager Used to display all standard ROOT elements like TCanvas or TFitPanel.
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
Random number generator class based on M.
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
- Date
- 2018-08-16
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Sergey Linev s.lin.nosp@m.ev@g.nosp@m.si.de
Definition in file rcanvas_mt.cxx.