From 9cbcfac0f845cb48db1b6372bad959302efefd7e Mon Sep 17 00:00:00 2001 From: khizmax Date: Fri, 10 Mar 2017 23:08:01 +0300 Subject: [PATCH] Minor stress-test change --- test/stress/main.cpp | 2 ++ test/stress/map/insdelfind/map_insdelfind.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/stress/main.cpp b/test/stress/main.cpp index 8a60761a..c9bc90db 100644 --- a/test/stress/main.cpp +++ b/test/stress/main.cpp @@ -55,6 +55,8 @@ int main( int argc, char **argv ) // Read test config file cds_test::init_config( argc, argv ); + std::cout << "Hardware concurrency: " << std::thread::hardware_concurrency() << "\n"; + // Init Google test ::testing::InitGoogleTest( &argc, argv ); diff --git a/test/stress/map/insdelfind/map_insdelfind.cpp b/test/stress/map/insdelfind/map_insdelfind.cpp index 642abd24..68faa318 100644 --- a/test/stress/map/insdelfind/map_insdelfind.cpp +++ b/test/stress/map/insdelfind/map_insdelfind.cpp @@ -60,7 +60,7 @@ namespace map { s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); if ( s_nThreadCount == 0 ) - s_nThreadCount = std::thread::hardware_concurrency() * 2; + s_nThreadCount = std::min( 16u, std::thread::hardware_concurrency() * 2 ); s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); if ( s_nMaxLoadFactor == 0 ) -- 2.34.1