14#include "arccore/concurrency/internal/ConcurrencyApplication.h"
16#include "arccore/base/CheckedConvert.h"
17#include "arccore/base/PlatformUtils.h"
18#include "arccore/base/FatalErrorException.h"
19#include "arccore/base/internal/DependencyInjection.h"
21#include "arccore/trace/ITraceMng.h"
23#include "arccore/concurrency/ITaskImplementation.h"
24#include "arccore/concurrency/IThreadImplementation.h"
25#include "arccore/concurrency/IThreadImplementationService.h"
26#include "arccore/concurrency/TaskFactory.h"
27#include "arccore/concurrency/internal/TaskFactoryInternal.h"
45 DependencyInjection::Injector injector;
46 injector.fillWithGlobalFactories();
49 injector.bind(m_trace.get());
54 auto t = injector.createInstance<InterfaceType>(s,
true);
67void ConcurrencyApplication::
68setCoreServices(
const ConcurrencyApplicationBuildInfo& build_info)
72 bool has_dbghelp =
false;
74 String dbghelp_service_name =
"DbgHelpStackTraceService";
79 if (v && v.value() != 0) {
80 names.add(
"BackwardCppStackTraceService");
82 names.add(
"LibUnwind");
83 names.add(
"DbgHelpStackTraceService");
84 sv = tryCreateServiceUsingInjector<IStackTraceService>(names.constView(), &found_name,
true);
85 if (found_name == dbghelp_service_name)
88 m_stack_trace_service = sv;
102 names.add(
"LLVMSymbolizer");
104 names.add(
"DbgHelpSymbolizerService");
105 sv = tryCreateServiceUsingInjector<ISymbolizerService>(names.constView(), &found_name,
true);
107 m_symbolizer_service = sv;
116 auto sv = tryCreateServiceUsingInjector<IThreadImplementationService>(names, &found_name,
false);
118 ARCCORE_FATAL(
"Can not find implementation for 'IThreadImplementation' (names='{0}').", names);
119 m_thread_implementation_service = sv;
120 m_thread_implementation = sv->createImplementation();
121 Arccore::Concurrency::setThreadImplementation(m_thread_implementation.get());
122 m_thread_implementation->initialize();
123 m_used_thread_service_name = found_name;
128 m_trace->resetThreadStatus();
132 Integer nb_task_thread = build_info.nbTaskThread();
133 if (nb_task_thread >= 0) {
137 auto sv = tryCreateServiceUsingInjector<ITaskImplementation>(names, &found_name,
false);
139 TaskFactoryInternal::setImplementation(sv.get());
140 sv->initialize(nb_task_thread);
141 m_used_task_service_name = found_name;
142 m_task_implementation = sv;
145 ARCCORE_FATAL(
"Can not find task implementation service (names='{0}')."
146 " Please check if Arcane is configured with Intel TBB library",
#define ARCCORE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Vue constante d'un tableau de type T.
Classe template pour convertir un type.
Référence à une instance.
Chaîne de caractères unicode.
static void setVerboseLevel(Integer v)
Positionne le niveau de verbosité (0 pour pas d'affichage qui est le défaut)
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.