Lumiera  0.pre.03
»edit your freedom«
ThreadWrapper_test Class Reference

Description

Test:
use the lib::Thread wrapper for simplified definition of the thread-function, argument binding and starting of threads.
See also
thread.hpp
ThreadWrapperJoin_test
SyncLocking_test

Definition at line 62 of file thread-wrapper-test.cpp.

Private Member Functions

void demonstrateSimpleUsage ()
 
virtual void run (Arg)
 
void verifyConcurrentExecution ()
 

Additional Inherited Members

- Public Member Functions inherited from Test
virtual void run (Arg arg)=0
 

Member Function Documentation

◆ demonstrateSimpleUsage()

void demonstrateSimpleUsage ( )
inlineprivate
Test:
demonstrate simple usage of the thread-wrapper a λ-binding

Definition at line 75 of file thread-wrapper-test.cpp.

◆ verifyConcurrentExecution()

void verifyConcurrentExecution ( )
inlineprivate
Test:
verify the thread function is actually performed concurrently
  • use a derived Thread object, also holding a local data field
  • the thread function sleeps, and then stores the sum of two numbers
  • demonstrate that each instance can have a different argument binding
  • verify each thread function has actually been invoked once per thread, by comparing a local sum with values collected from the Thread objects,
  • moreover measure the overall time required for launching the threads and then waiting for all threads to have terminated and detached; this time must be shorter than all the average sleep times compounded (as if the function was invoked sequentially).

< the actual operation running in a separate thread

Definition at line 98 of file thread-wrapper-test.cpp.

+ Inheritance diagram for ThreadWrapper_test:
+ Collaboration diagram for ThreadWrapper_test:

The documentation for this class was generated from the following file: