Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
CallQueue_test Class Reference

Description

Test:
verify a helper component for dispatching functors through a threadsafe queue.
  • simple usage
  • enqueue and dequeue several functors
  • multithreaded load test
See also
lib::CallQueue
stage::NotificationService usage example
DemoGuiRoundtrip

Definition at line 102 of file call-queue-test.cpp.

Classes

struct  Worker
 

Private Types

using Workers = lib::ScopedCollection< Worker >
 

Private Member Functions

virtual void run (Arg)
 
void verify_SimpleUse ()
 
void verify_Consistency ()
 
void verify_ThreadSafety ()
 

Member Typedef Documentation

◆ Workers

Definition at line 211 of file call-queue-test.cpp.

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

Definition at line 106 of file call-queue-test.cpp.

References CallQueue_test::verify_Consistency(), CallQueue_test::verify_SimpleUse(), and CallQueue_test::verify_ThreadSafety().

+ Here is the call graph for this function:

◆ verify_SimpleUse()

void verify_SimpleUse ( )
inlineprivate

Definition at line 115 of file call-queue-test.cpp.

References CallQueue::feed(), CallQueue::invoke(), and CallQueue::size().

Referenced by CallQueue_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_Consistency()

void verify_Consistency ( )
inlineprivate
Test:
consistency of queue data handling
  • functors of various types can be mixed
  • entries are moved in and out of the queue
  • no copying whatsoever happens
  • each entry gets invoked
  • all entries are invoked in order
  • enqueuing and dequeuing can be interspersed
  • no memory leaks in bound argument data

Definition at line 145 of file call-queue-test.cpp.

References CallQueue::feed(), and CallQueue::invoke().

Referenced by CallQueue_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_ThreadSafety()

void verify_ThreadSafety ( )
inlineprivate
Test:
torture the CallQueue by massively multithreaded dispatch
  • start #NUM_OF_THREADS (e.g. 50) threads in parallel
  • each of those has a randomised execution pattern to add new functors and dispatch other thread's functors

Definition at line 221 of file call-queue-test.cpp.

References ThreadJoinable< RES >::join().

Referenced by CallQueue_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for CallQueue_test:
+ Collaboration diagram for CallQueue_test:

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