ROOT
Version v6.32
master
v6.34
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
mt301_TTaskGroupSimple.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_multicore
3
/// \notebook -js
4
/// Shows how to run items of work asynchronously with a TTaskGroup.
5
///
6
/// \macro_code
7
///
8
/// \date August 2017
9
/// \author Danilo Piparo
10
11
void
workItem0
()
12
{
13
printf
(
"Running workItem0...\n"
);
14
}
15
16
void
mt301_TTaskGroupSimple
()
17
{
18
19
ROOT::EnableImplicitMT
(4);
20
21
// Create the task group and give work to it
22
ROOT::Experimental::TTaskGroup
tg
;
23
24
tg
.Run(
workItem0
);
25
tg
.Run([]() {
printf
(
"Running workItem1...\n"
); });
26
27
printf
(
"Running something in the \"main\" thread\n"
);
28
29
// Wait until all items are complete
30
tg
.Wait();
31
32
printf
(
"All work completed.\n"
);
33
}
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
ROOT::Experimental::TTaskGroup
A class to manage the asynchronous execution of work items.
Definition
TTaskGroup.hxx:26
ROOT::EnableImplicitMT
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
Definition
TROOT.cxx:539
tutorials
multicore
mt301_TTaskGroupSimple.C
ROOT tags/v6-32-12 - Reference Guide Generated on Tue Apr 8 2025 06:01:06 (GVA Time) using Doxygen 1.10.0