1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
jsteemann 2018-07-23 14:59:17 +02:00
commit bb4ba12797
2 changed files with 6 additions and 14 deletions

View File

@ -272,9 +272,9 @@ while [ $# -gt 0 ]; do
CXX="" CXX=""
PAR="" PAR=""
PARALLEL_BUILDS="" PARALLEL_BUILDS=""
GENERATOR="Visual Studio 14 Win64" GENERATOR="Visual Studio 15 Win64"
CONFIGURE_OPTIONS+=("-T") CONFIGURE_OPTIONS+=("-T")
CONFIGURE_OPTIONS+=("v140,host=x64") CONFIGURE_OPTIONS+=("v141,host=x64")
MAKE="cmake --build . --config ${BUILD_CONFIG}" MAKE="cmake --build . --config ${BUILD_CONFIG}"
PACKAGE_MAKE="cmake --build . --config ${BUILD_CONFIG} --target" PACKAGE_MAKE="cmake --build . --config ${BUILD_CONFIG} --target"
CONFIGURE_OPTIONS+=("-DOPENSSL_USE_STATIC_LIBS=TRUE") CONFIGURE_OPTIONS+=("-DOPENSSL_USE_STATIC_LIBS=TRUE")

View File

@ -572,7 +572,7 @@ IResearchFeature::Async::Async(): _terminate(false) {
static const unsigned int MIN_THREADS = 1; // at least one thread is required static const unsigned int MIN_THREADS = 1; // at least one thread is required
auto poolSize = std::max( auto poolSize = std::max(
MIN_THREADS, MIN_THREADS,
std::min(MAX_THREADS, std::thread::hardware_concurrency()) std::min(MAX_THREADS, std::thread::hardware_concurrency() / 4) // arbitrary fraction of available cores
); );
for (size_t i = 0; i < poolSize; ++i) { for (size_t i = 0; i < poolSize; ++i) {
@ -639,6 +639,7 @@ void IResearchFeature::Async::start() {
IResearchFeature::IResearchFeature(arangodb::application_features::ApplicationServer* server) IResearchFeature::IResearchFeature(arangodb::application_features::ApplicationServer* server)
: ApplicationFeature(server, IResearchFeature::name()), : ApplicationFeature(server, IResearchFeature::name()),
_async(std::make_unique<Async>()),
_running(false) { _running(false) {
setOptional(true); setOptional(true);
startsAfter("V8Phase"); startsAfter("V8Phase");
@ -651,12 +652,10 @@ void IResearchFeature::async(
std::shared_ptr<ResourceMutex> const& mutex, std::shared_ptr<ResourceMutex> const& mutex,
Async::Fn &&fn Async::Fn &&fn
) { ) {
TRI_ASSERT(_async);
_async->emplace(mutex, std::move(fn)); _async->emplace(mutex, std::move(fn));
} }
void IResearchFeature::asyncNotify() const { void IResearchFeature::asyncNotify() const {
TRI_ASSERT(_async);
_async->notify(); _async->notify();
} }
@ -681,14 +680,6 @@ void IResearchFeature::prepare() {
return; return;
} }
if (!ServerState::instance()->isCoordinator() &&
!ServerState::instance()->isAgent()) {
// no need to start the thread pool on the coordinator or on an agent.
// threads are only needed on single server or DB servers
// in a cluster
_async = std::make_unique<Async>();
}
_running = false; _running = false;
ApplicationFeature::prepare(); ApplicationFeature::prepare();
@ -755,6 +746,7 @@ void IResearchFeature::unprepare() {
if (!isEnabled()) { if (!isEnabled()) {
return; return;
} }
_running = false; _running = false;
ApplicationFeature::unprepare(); ApplicationFeature::unprepare();
} }
@ -771,4 +763,4 @@ NS_END // arangodb
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE // --SECTION-- END-OF-FILE
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------