The existing TypedCounter_test was excessively clever and convoluted, yet failed to test the critical elements systematically. Indeed, two bugs were hidden in synchronisation and instance access. - build a new concurrent test from scratch, now using the threadBenchmark function for the actual concurrent execution and just invoked a random selected access to the counter repeatedly from a large number of threads. - rework the TypedContext and counter to use Atomics where applicable; measurements indicate however that this has only negligible impact on the amortised invocation times, which are around 60ns for single-threaded access, yet can increase by factor 100 due to contention.
49 lines
818 B
Text
49 lines
818 B
Text
TESTING "Library Test Suite: concurrency helpers" ./test-suite --group=common
|
|
|
|
|
|
|
|
TEST "Multithread Locking by Monitor" SyncLocking_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Multithread Locking class level" SyncClasslock_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "N-fold synchronisation barrier" SyncBarrier_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Yield-waiting sync performance" SyncBarrierPerformance_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Wait/Notify on Object Monitor" SyncWaiting_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Wait/Notify with timeout" SyncTimedwait_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Run function concurrently" ThreadWrapper_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Waiting on Thread termination" ThreadWrapperJoin_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|
|
TEST "Detect running in specific Thread" ThreadWrapperSelfRecognitionTest_test <<END
|
|
return: 0
|
|
END
|
|
|
|
|