22 void *handle(
void *ptr)
25 Long64_t nfills = 25000000;
29 sprintf(name,
"hpx%ld",nr);
31 hpx[nr] =
new TH1F(name,
"This is the px distribution",100,-4,4);
32 hpx[nr]->SetFillColor(48);
36 for (Int_t i = 0; i < nfills; i++) {
37 gRandom->Rannor(px,py);
40 if (i && (i%upd) == 0) {
47 if (c[nr]) c[nr]->Modified();
80 c[0] =
new TCanvas(
"c0",
"Dynamic Filling Example",100,20,400,300);
81 c[0]->SetFillColor(42);
82 c[0]->GetFrame()->SetFillColor(21);
83 c[0]->GetFrame()->SetBorderSize(6);
84 c[0]->GetFrame()->SetBorderMode(-1);
85 c[1] =
new TCanvas(
"c1",
"Dynamic Filling Example",510,20,400,300);
86 c[1]->SetFillColor(42);
87 c[1]->GetFrame()->SetFillColor(21);
88 c[1]->GetFrame()->SetBorderSize(6);
89 c[1]->GetFrame()->SetBorderMode(-1);
90 c[2] =
new TCanvas(
"c2",
"Dynamic Filling Example",100,350,400,300);
91 c[2]->SetFillColor(42);
92 c[2]->GetFrame()->SetFillColor(21);
93 c[2]->GetFrame()->SetBorderSize(6);
94 c[2]->GetFrame()->SetBorderMode(-1);
95 c[3] =
new TCanvas(
"c3",
"Dynamic Filling Example",510,350,400,300);
96 c[3]->SetFillColor(42);
97 c[3]->GetFrame()->SetFillColor(21);
98 c[3]->GetFrame()->SetBorderSize(6);
99 c[3]->GetFrame()->SetBorderMode(-1);
102 c[0]->Connect(
"Closed()", 0, 0,
"closed(Int_t=0)");
103 c[1]->Connect(
"Closed()", 0, 0,
"closed(Int_t=1)");
104 c[2]->Connect(
"Closed()", 0, 0,
"closed(Int_t=2)");
105 c[3]->Connect(
"Closed()", 0, 0,
"closed(Int_t=3)");
107 printf(
"Starting Thread 0\n");
108 t[0] =
new TThread(
"t0", handle, (
void*) 0);
110 printf(
"Starting Thread 1\n");
111 t[1] =
new TThread(
"t1", handle, (
void*) 1);
113 printf(
"Starting Thread 2\n");
114 t[2] =
new TThread(
"t2", handle, (
void*) 2);
116 printf(
"Starting Thread 3\n");
117 t[3] =
new TThread(
"t3", handle, (
void*) 3);
119 printf(
"Starting Thread 4\n");
120 t[4] =
new TThread(
"t4", joiner, (
void*) 3);
126 for (
int i = 0; i < 4; i++) {
127 if (c[i] && c[i]->IsModified()) {
133 gSystem->ProcessEvents();