@@ -27,11 +27,18 @@ A class that represents an explicit, user-managed task scheduler arena.
2727 };
2828
2929 struct constraints {
30- numa_node_id numa_node;
31- int max_concurrency;
32-
3330 constraints(numa_node_id numa_node_ = task_arena::automatic,
3431 int max_concurrency_ = task_arena::automatic);
32+
33+ constraints& set_numa_id(numa_node_id id);
34+ constraints& set_max_concurrency(int maximal_concurrency);
35+ constraints& set_core_type(core_type_id id);
36+ constraints& set_max_threads_per_core(int threads_number);
37+
38+ numa_node_id numa_id = task_arena::automatic;
39+ int max_concurrency = task_arena::automatic;
40+ core_type_id core_type = task_arena::automatic;
41+ int max_threads_per_core = task_arena::automatic;
3542 };
3643
3744 task_arena(int max_concurrency = automatic, unsigned reserved_for_masters = 1,
@@ -113,16 +120,61 @@ Member types and constants
113120
114121 Represents limitations applied to threads within ``task_arena ``.
115122
116- ``numa_node `` - An integral logical index uniquely identifying a NUMA node.
117- All threads joining the ``task_arena `` are bound to this NUMA node.
123+ Starting from C++20 this class should be an aggregate type to support the designated initialization.
124+
125+ .. cpp :member :: numa_node_id constraints::numa_id
126+
127+ An integral logical index uniquely identifying a NUMA node.
128+ If set to non-automatic value, then this NUMA node will be considered as preferred for all the
129+ threads within the arena.
118130
119131 .. note ::
120132
121133 NUMA node ID is considered valid if it was obtained through tbb::info: :numa_nodes().
122134
123- ``max_concurrency `` - The maximum number of threads that can participate in work processing
135+ .. cpp :member :: int constraints::max_concurrency
136+
137+ The maximum number of threads that can participate in work processing
124138 within the ``task_arena `` at the same time.
125139
140+ .. cpp :member :: core_type_id constraints::core_type
141+
142+ An integral logical index uniquely identifying a core type.
143+ If set to non-automatic value, then this core type will be considered as preferred for all the
144+ threads within the arena.
145+
146+ .. note ::
147+
148+ core type ID is considered valid if it was obtained through ``tbb::info::core_types() ``.
149+
150+ .. cpp :member :: int constraints::max_threads_per_core
151+
152+ The maximum number of threads that can be scheduled to one core simultaneously.
153+
154+ .. cpp :function :: constraints::constraints(numa_node_id numa_node_ = task_arena::automatic, int max_concurrency_ = task_arena::automatic)
155+
156+ Constructs the constraints object with the provided `numa_id ` and `max_concurrency ` settings.
157+
158+ .. note ::
159+
160+ To support designated initialization this constructor is omitted starting from C++20. Aggregate initialization is supposed to be used instead.
161+
162+ .. cpp :function :: constraints& constraints::set_numa_id (numa_node_id id)
163+
164+ Sets the `numa_id ` to the provided ``id ``. Returns the reference to the updated constraints object.
165+
166+ .. cpp :function :: constraints& constraints::set_max_concurrency (int maximal_concurrency)
167+
168+ Sets the `max_concurrency ` to the provided ``maximal_concurrency ``. Returns the reference to the updated constraints object.
169+
170+ .. cpp :function :: constraints& constraints::set_core_type (core_type_id id)
171+
172+ Sets the `core_type ` to the provided ``id ``. Returns the reference to the updated constraints object.
173+
174+ .. cpp :function :: constraints& constraints::set_max_threads_per_core (int threads_number)
175+
176+ Sets the `max_threads_per_core ` to the provided ``threads_number ``. Returns the reference to the updated constraints object.
177+
126178Member functions
127179----------------
128180
0 commit comments