Arcane  v3.16.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
ConcurrencyGlobal.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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-2025 */
9/* */
10/* Définitions globales de la composante 'Concurrency' de '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{
36class Mutex;
37class SpinLock;
38class GlobalMutex;
39class IThreadBarrier;
42
43//@{ Classe internes à Arccore/Arcane
44class SpinLockImpl;
46//@}
47
48//! Classe opaque encapsulant l'implementation des threads
49class ThreadImpl;
50//! Classe opaque encapsulant l'implementation d'un mutex
51class MutexImpl;
52} // namespace Arcane
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
62namespace Arcane::Concurrency
63{
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68extern "C++" ARCCORE_CONCURRENCY_EXPORT IThreadImplementation*
69getThreadImplementation();
70extern "C++" ARCCORE_CONCURRENCY_EXPORT IThreadImplementation*
71setThreadImplementation(IThreadImplementation* impl);
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
75
76extern "C++" ARCCORE_CONCURRENCY_EXPORT Ref<IThreadImplementation>
77createGlibThreadImplementation();
78
79extern "C++" ARCCORE_CONCURRENCY_EXPORT Ref<IThreadImplementation>
80createStdThreadImplementation();
81
82extern "C++" ARCCORE_CONCURRENCY_EXPORT Ref<IThreadImplementation>
83createNullThreadImplementation();
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88} // namespace Arcane::Concurrency
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93namespace Arccore
94{
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99using Arcane::GlibThreadImplementation;
100using Arcane::GlobalMutex;
101using Arcane::IThreadBarrier;
102using Arcane::IThreadImplementation;
103using Arcane::Mutex;
104using Arcane::MutexImpl;
105using Arcane::NullThreadBarrier;
106using Arcane::NullThreadImplementation;
107using Arcane::SpinLock;
108using Arcane::SpinLockImpl;
109using Arcane::ThreadImpl;
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114}
115
116/*---------------------------------------------------------------------------*/
117/*---------------------------------------------------------------------------*/
118
119namespace Arccore::Concurrency
120{
121using Arcane::Concurrency::getThreadImplementation;
122using Arcane::Concurrency::setThreadImplementation;
123using Arcane::Concurrency::createGlibThreadImplementation;
124using Arcane::Concurrency::createStdThreadImplementation;
125using Arcane::Concurrency::createNullThreadImplementation;
126}
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
131#endif
#define ARCCORE_DECLARE_REFERENCE_COUNTED_CLASS(class_name)
Macro pour déclarer qu'une classe utilise un compteur de référence.
Implémentation de ITreadImplementation avec la 'Glib'.
Interface d'un service implémentant le support des threads.
Implémentation d'une barrière en mono-thread.
Implémentation des threads en mode mono-thread.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Espace de nom de Arccore.