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"
48 DependencyInjection::Injector injector;
49 injector.fillWithGlobalFactories();
52 injector.bind(m_trace.get());
57 auto t = injector.createInstance<InterfaceType>(s,
true);
70void ConcurrencyApplication::
71setCoreServices(
const ConcurrencyApplicationBuildInfo& build_info)
74 bool has_dbghelp =
false;
76 String dbghelp_service_name =
"DbgHelpStackTraceService";
81 if (v && v.value() != 0) {
82 names.add(
"BackwardCppStackTraceService");
84 names.add(
"LibUnwind");
85 names.add(
"DbgHelpStackTraceService");
86 sv = tryCreateServiceUsingInjector<IStackTraceService>(names.constView(), &found_name,
true);
87 if (found_name == dbghelp_service_name)
90 m_stack_trace_service = sv;
105 names.add(
"LLVMSymbolizer");
107 names.add(
"DbgHelpSymbolizerService");
108 sv = tryCreateServiceUsingInjector<ISymbolizerService>(names.constView(), &found_name,
true);
110 m_symbolizer_service = sv;
119 auto sv = tryCreateServiceUsingInjector<IThreadImplementationService>(names, &found_name,
false);
121 ARCCORE_FATAL(
"Can not find implementation for 'IThreadImplementation' (names='{0}').", names);
122 m_thread_implementation_service = sv;
123 m_thread_implementation = sv->createImplementation();
124 Arccore::Concurrency::setThreadImplementation(m_thread_implementation.get());
125 m_thread_implementation->initialize();
126 m_used_thread_service_name = found_name;
131 m_trace->resetThreadStatus();
135 Integer nb_task_thread = build_info.nbTaskThread();
136 if (nb_task_thread >= 0) {
140 auto sv = tryCreateServiceUsingInjector<ITaskImplementation>(names, &found_name,
false);
142 TaskFactoryInternal::setImplementation(sv.get());
143 sv->initialize(nb_task_thread);
144 m_used_task_service_name = found_name;
145 m_task_implementation = sv;
148 ARCCORE_FATAL(
"Can not find task implementation service (names='{0}')."
149 " Please check if Arcane is configured with Intel TBB library",
#define ARCCORE_FATAL(...)
Macro throwing a FatalErrorException.
Constant view of an array of type T.
Template class for converting a type.
Reference to an instance.
Unicode character string.
static void setVerboseLevel(Integer v)
Sets the verbosity level (0 for no output, which is the default).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.