diff --git a/tests/basics/call-queue-test.cpp b/tests/basics/call-queue-test.cpp index b391ef9a3..418bcbe00 100644 --- a/tests/basics/call-queue-test.cpp +++ b/tests/basics/call-queue-test.cpp @@ -27,13 +27,13 @@ #include "lib/test/run.hpp" #include "lib/scoped-collection.hpp" -#include "vault/thread-wrapper.hpp" +#include "lib/sync-barrier.hpp" +#include "lib/thread.hpp" #include "lib/sync.hpp" #include "lib/util.hpp" #include "lib/call-queue.hpp" -#include #include @@ -42,11 +42,11 @@ namespace lib { namespace test{ using lib::Sync; - using vault::ThreadJoinable; + using lib::SyncBarrier; + using lib::ThreadJoinable; using util::isnil; using std::string; - using std::bind; @@ -103,8 +103,7 @@ namespace test{ * @test verify a helper component for dispatching functors through a threadsafe queue. * - simple usage * - enqueue and dequeue several functors - * - multithreaded stress test - * + * - multithreaded load test * @see lib::CallQueue * @see stage::NotificationService usage example * @see [DemoGuiRoundtrip](http://issues.lumiera.org/ticket/1099 "Ticket #1099") @@ -181,12 +180,14 @@ namespace test{ struct Worker - : ThreadJoinable + : ThreadJoinable<> , Sync<> { uint64_t producerSum = 0; uint64_t consumerSum = 0; + SyncBarrier& trigger_; + void countConsumerCall (uint increment) { @@ -194,13 +195,13 @@ namespace test{ consumerSum += increment; } - Worker(CallQueue& queue) + Worker(CallQueue& queue, SyncBarrier& commonTrigger) : ThreadJoinable{"CallQueue_test: concurrent dispatch" , [&]() { uint cnt = rand() % MAX_RAND_STEPS; uint delay = rand() % MAX_RAND_DELAY; - syncPoint(); // block until all threads are ready + trigger_.sync(); // block until all threads are ready for (uint i=0; i(queue); + storage.create (queue, trigger); } }; // unleash all worker functions - for (auto& thread : workers) - thread.sync(); + trigger.sync(); - // wait for termination of all threads + // wait for termination of all threads and detect possible exceptions + bool allFine{true}; for (auto& worker : workers) - worker.join(); + allFine &= worker.join().isValid(); + CHECK (allFine); // collect the results of all worker threads uint64_t globalProducerSum = 0; diff --git a/tests/core/steam/control/session-command-function-test.cpp b/tests/core/steam/control/session-command-function-test.cpp index f8bf38a21..d5ff5a6a5 100644 --- a/tests/core/steam/control/session-command-function-test.cpp +++ b/tests/core/steam/control/session-command-function-test.cpp @@ -69,7 +69,7 @@ ** verify the checksum before all command instances have been triggered. To avoid this ** situation, make sure the delay between actions in the threads is not too long and ** start a sufficiently high number of producer threads. - ** + ** */ @@ -88,7 +88,6 @@ extern "C" { #include "lib/thread.hpp" #include "lib/symbol.hpp" #include "lib/util.hpp" -#include "lib/test/diagnostic-output.hpp"////////////////////TODO #include #include @@ -216,7 +215,7 @@ namespace test { } //-------------(End)FIXTURE - + virtual void run (Arg args_for_stresstest) { diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 7b9de7a5a..90e979f45 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -81084,7 +81084,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + + +