Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-01-15 14:26:12 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-03-16 13:21:40 +0300
commit73f5571337a4760d526ea378d96f5b93693beb17 (patch)
tree10e4db01e0176c2532c810ab8de9faf971ccb599 /test
parent476b74799c4504a248d2fe63ae060f8eead21c47 (diff)
Make the dynamic thread pool work scheduling not quite as strict in the native Linux implementation, now we only examine higher priority groups once per group cycle. This produces behaviours much more consistent with the Win32 thread pool and Grand Central Dispatch.
Diffstat (limited to 'test')
-rw-r--r--test/tests/dynamic_thread_pool_group.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/tests/dynamic_thread_pool_group.cpp b/test/tests/dynamic_thread_pool_group.cpp
index a40d3b05..6e985fc8 100644
--- a/test/tests/dynamic_thread_pool_group.cpp
+++ b/test/tests/dynamic_thread_pool_group.cpp
@@ -226,6 +226,11 @@ static inline void TestDynamicThreadPoolGroupWorks()
static inline void TestDynamicThreadPoolGroupNestingWorks()
{
+ if(std::thread::hardware_concurrency() < 4)
+ {
+ std::cout << "NOTE: Skipping TestDynamicThreadPoolGroupNestingWorks as hardware concurrency is below 4." << std::endl;
+ return;
+ }
namespace llfio = LLFIO_V2_NAMESPACE;
static constexpr size_t MAX_NESTING = 10;
static constexpr int COUNT_PER_WORK_ITEM = 1000;
@@ -299,6 +304,7 @@ static inline void TestDynamicThreadPoolGroupNestingWorks()
}
uint64_t idx = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
std::lock_guard<std::mutex> g(shared_states[nesting].lock);
+ //std::cout << "wi " << this << " nesting " << nesting << " work " << work << std::endl;
if(COUNT_PER_WORK_ITEM == work && childwi)
{
if(!shared_states[nesting].tpg)
@@ -438,8 +444,8 @@ static inline void TestDynamicThreadPoolGroupIoAwareWorks()
BOOST_CHECK(paced > 0);
}
-//KERNELTEST_TEST_KERNEL(integration, llfio, dynamic_thread_pool_group, works, "Tests that llfio::dynamic_thread_pool_group works as expected",
-// TestDynamicThreadPoolGroupWorks())
+KERNELTEST_TEST_KERNEL(integration, llfio, dynamic_thread_pool_group, works, "Tests that llfio::dynamic_thread_pool_group works as expected",
+ TestDynamicThreadPoolGroupWorks())
KERNELTEST_TEST_KERNEL(integration, llfio, dynamic_thread_pool_group, nested, "Tests that nesting of llfio::dynamic_thread_pool_group works as expected",
TestDynamicThreadPoolGroupNestingWorks())
//KERNELTEST_TEST_KERNEL(integration, llfio, dynamic_thread_pool_group, io_aware_work_item,