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/IStackTraceService.h"
20#include "arccore/base/internal/DependencyInjection.h"
22#include "arccore/trace/ITraceMng.h"
24#include "arccore/concurrency/ITaskImplementation.h"
25#include "arccore/concurrency/IThreadImplementation.h"
26#include "arccore/concurrency/IThreadImplementationService.h"
27#include "arccore/concurrency/TaskFactory.h"
28#include "arccore/concurrency/internal/TaskFactoryInternal.h"
49 DependencyInjection::Injector injector;
50 injector.fillWithGlobalFactories();
53 injector.bind(m_trace.get());
58 auto t = injector.createInstance<InterfaceType>(s,
true);
71void ConcurrencyApplication::
72setCoreServices(
const ConcurrencyApplicationBuildInfo& build_info)
75 bool has_dbghelp =
false;
77 String dbghelp_service_name =
"DbgHelpStackTraceService";
82 if (v && v.value() != 0) {
83 names.add(
"BackwardCppStackTraceService");
85 names.add(
"LibUnwind");
86 names.add(
"DbgHelpStackTraceService");
87 sv = tryCreateServiceUsingInjector<IStackTraceService>(names.constView(), &found_name,
true);
88 if (found_name == dbghelp_service_name)
92 m_stack_trace_service = sv;
107 names.add(
"LLVMSymbolizer");
109 names.add(
"DbgHelpSymbolizerService");
110 sv = tryCreateServiceUsingInjector<ISymbolizerService>(names.constView(), &found_name,
true);
112 m_symbolizer_service = sv;
121 auto sv = tryCreateServiceUsingInjector<IThreadImplementationService>(names, &found_name,
false);
123 ARCCORE_FATAL(
"Can not find implementation for 'IThreadImplementation' (names='{0}').", names);
124 m_thread_implementation_service = sv;
125 m_thread_implementation = sv->createImplementation();
126 Arccore::Concurrency::setThreadImplementation(m_thread_implementation.get());
127 m_thread_implementation->initialize();
128 m_used_thread_service_name = found_name;
133 m_trace->resetThreadStatus();
137 Integer nb_task_thread = build_info.nbTaskThread();
138 if (nb_task_thread >= 0) {
142 auto sv = tryCreateServiceUsingInjector<ITaskImplementation>(names, &found_name,
false);
144 TaskFactoryInternal::setImplementation(sv.get());
145 sv->initialize(nb_task_thread);
146 m_used_task_service_name = found_name;
147 m_task_implementation = sv;
150 ARCCORE_FATAL(
"Can not find task implementation service (names='{0}')."
151 " 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.