Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ConcurrencyGlobal.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/* ConcurrencyGlobal.h (C) 2000-2026 */
9/* */
10/* Global definitions of the 'Concurrency' component of 'Arccore'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_CONCURRENCY_CONCURRENCYGLOBAL_H
13#define ARCCORE_CONCURRENCY_CONCURRENCYGLOBAL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22#if defined(ARCCORE_COMPONENT_arccore_concurrency)
23#define ARCCORE_CONCURRENCY_EXPORT ARCCORE_EXPORT
24#define ARCCORE_CONCURRENCY_EXTERN_TPL
25#else
26#define ARCCORE_CONCURRENCY_EXPORT ARCCORE_IMPORT
27#define ARCCORE_CONCURRENCY_EXTERN_TPL extern
28#endif
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33namespace Arcane
34{
37class Mutex;
38class SpinLock;
39class GlobalMutex;
40class IThreadBarrier;
46class ITask;
47class TaskContext;
48class TaskFactory;
49class ITaskFunctor;
50template <typename InstanceType> class TaskFunctor;
51template <typename InstanceType> class TaskFunctorWithContext;
52
54class SpinLockImpl;
57
59class ThreadImpl;
61class MutexImpl;
62} // namespace Arcane
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72namespace Arcane::Concurrency
73{
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78extern "C++" ARCCORE_CONCURRENCY_EXPORT IThreadImplementation*
79getThreadImplementation();
80extern "C++" ARCCORE_CONCURRENCY_EXPORT IThreadImplementation*
81setThreadImplementation(IThreadImplementation* impl);
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86extern "C++" ARCCORE_CONCURRENCY_EXPORT Ref<IThreadImplementation>
87createGlibThreadImplementation();
88
89extern "C++" ARCCORE_CONCURRENCY_EXPORT Ref<IThreadImplementation>
90createStdThreadImplementation();
91
92extern "C++" ARCCORE_CONCURRENCY_EXPORT Ref<IThreadImplementation>
93createNullThreadImplementation();
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98} // namespace Arcane::Concurrency
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103namespace Arccore
104{
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109using Arcane::GlibThreadImplementation;
110using Arcane::GlobalMutex;
111using Arcane::IThreadBarrier;
112using Arcane::IThreadImplementation;
113using Arcane::Mutex;
114using Arcane::MutexImpl;
115using Arcane::NullThreadBarrier;
116using Arcane::NullThreadImplementation;
117using Arcane::SpinLock;
118using Arcane::SpinLockImpl;
119using Arcane::ThreadImpl;
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124} // namespace Arccore
125
126/*---------------------------------------------------------------------------*/
127/*---------------------------------------------------------------------------*/
128
129namespace Arccore::Concurrency
130{
131using Arcane::Concurrency::createGlibThreadImplementation;
132using Arcane::Concurrency::createNullThreadImplementation;
133using Arcane::Concurrency::createStdThreadImplementation;
134using Arcane::Concurrency::getThreadImplementation;
135using Arcane::Concurrency::setThreadImplementation;
136} // namespace Arccore::Concurrency
137
138/*---------------------------------------------------------------------------*/
139/*---------------------------------------------------------------------------*/
140
141#endif
#define ARCCORE_DECLARE_REFERENCE_COUNTED_CLASS(class_name)
Macro to declare that a class uses a reference counter.
Implementation of ITreadImplementation with 'Glib'.
Interface for a task functor.
Definition Task.h:76
Implementation of a task factory.
Interface for a concurrent task.
Definition Task.h:194
Implementation of a single-threaded barrier.
Implementation of threads in single-threaded mode.
Characteristics of a multi-thread 1D loop.
Definition ParallelFor.h:35
Execution context of a task.
Definition Task.h:50
Internal Arcane API for 'TaskFactory'.
Factory for tasks.
Definition TaskFactory.h:35
Functor for a task taking a TaskContext as an argument.
Definition Task.h:150
Functor without arguments for a task.
Definition Task.h:104
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Namespace of Arccore.