40void draw_canvas(
const std::string &title,
Int_t col1)
43 auto hist1 =
new TH1D(
"hist1",
"hist1", 100, -10, 10);
44 auto hist2 =
new TH1D(
"hist2",
"hist2", 100, -10, 10);
46 hist1->SetLineColor(col1);
47 hist2->SetLineColor(
kBlue);
52 for (
int n = 0;
n < 10000; ++
n) {
68 std::cout << title <<
" started" << std::endl;
70 for (
int loop = 0; loop < maxloop; ++loop) {
72 for (
int n = 0;
n < 10000; ++
n) {
89 std::cout << title <<
" completed" << std::endl;
95void rcanvas_mt(
bool block_main_thread =
true)
99 if (block_main_thread) {
102 gEnv->SetValue(
"WebGui.HttpThrd",
"yes");
105 gEnv->SetValue(
"WebGui.SenderThrds",
"yes");
113 std::thread thrd1(draw_canvas,
"First canvas",
kRed);
114 std::thread thrd2(draw_canvas,
"Second canvas",
kBlue);
115 std::thread thrd3(draw_canvas,
"Third canvas",
kGreen);
117 if (block_main_thread) {
int Int_t
Signed integer 4 bytes (int).
float Float_t
Float 4 bytes (float).
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
static std::shared_ptr< RWebWindowsManager > & Instance()
Returns default window manager Used to display all standard ROOT elements like TCanvas or TFitPanel.
TDirectory::TContext keeps track and restore the current directory.
1-D histogram with a double per channel (see TH1 documentation)
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.
Namespace for ROOT features in testing.
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...