38void draw_canvas(
const std::string &title,
RColor col)
42 auto pHist = std::make_shared<RH1D>(xaxis);
43 auto pHist2 = std::make_shared<RH1D>(xaxis);
48 for (
int n = 0;
n < 10000; ++
n) {
57 canvas->Draw<RFrameTitle>(title);
58 canvas->Draw(pHist)->line.color = col;
65 std::cout << title <<
" started" <<std::endl;
67 for (
int loop = 0; loop < maxloop; ++loop) {
69 for (
int n = 0;
n < 10000; ++
n) {
86 std::cout << title <<
" completed" <<std::endl;
92void rcanvas_mt(
bool block_main_thread =
true)
94 if (block_main_thread) {
97 gEnv->SetValue(
"WebGui.HttpThrd",
"yes");
100 gEnv->SetValue(
"WebGui.SenderThrds",
"yes");
108 std::thread thrd1(draw_canvas,
"First canvas",
RColor::kRed);
109 std::thread thrd2(draw_canvas,
"Second canvas",
RColor::kBlue);
112 if (block_main_thread) {
Objects used to configure the different axis types.
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kRed
static R__DLLEXPORT constexpr RGB_t kGreen
static R__DLLEXPORT constexpr RGB_t kBlue
static std::shared_ptr< RWebWindowsManager > & Instance()
Returns default window manager Used to display all standard ROOT elements like TCanvas or TFitPanel.
Random number generator class based on M.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...