Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ConcurrencyBase.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ConcurrencyBase.h (C) 2000-2025 */
9/* */
10/* Base classes for multi-threading management. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_BASE_CONCURRENCYBASE_H
13#define ARCCORE_BASE_CONCURRENCYBASE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/ParallelLoopOptions.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Basic information for multi-threading management.
30 */
31class ARCCORE_BASE_EXPORT ConcurrencyBase
32{
33 // To call _setMaxAllowedThread.
34 friend class TBBTaskImplementation;
35
36 public:
37
38 /*!
39 * \brief Maximum number of allowed threads for multi-threading.
40 *
41 * This value is only meaningful once the management service
42 * for multi-threading has been created.
43 */
44 static Int32 maxAllowedThread() { return m_max_allowed_thread; }
45
46 public:
47
48 //! Sets the default execution values for a parallel loop
50 {
51 m_default_loop_options = v;
52 }
53
54 //! Default execution values for a parallel loop
56 {
57 return m_default_loop_options;
58 }
59
60 private:
61
62 static Int32 m_max_allowed_thread;
63 static ParallelLoopOptions m_default_loop_options;
64
65 private:
66
67 static void _setMaxAllowedThread(Int32 v);
68};
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72
73} // End namespace Arcane
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78#endif
Basic information for multi-threading management.
static void setDefaultParallelLoopOptions(const ParallelLoopOptions &v)
Sets the default execution values for a parallel loop.
static Int32 maxAllowedThread()
Maximum number of allowed threads for multi-threading.
static const ParallelLoopOptions & defaultParallelLoopOptions()
Default execution values for a parallel loop.
Execution options for a parallel loop in multi-threading.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.