Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | List of all members
TestMemModelSCDRF00 Class Reference

test_mm_sc_drf_00: Testing SC-DRF non-atomic global read and write within an atomic acquire/release critical block. More...

Collaboration diagram for TestMemModelSCDRF00:

Public Member Functions

 TestMemModelSCDRF00 ()
 
void test01_Read1Write1 ()
 
void test02_Read2Write1 ()
 
void test03_Read4Write1 ()
 
void test11_Read10Write10 ()
 
void test12_Read10Write10 ()
 
void test_list ()
 

Detailed Description

test_mm_sc_drf_00: Testing SC-DRF non-atomic global read and write within an atomic acquire/release critical block.

Modified non-atomic memory within the atomic acquire (load) and release (store) block, must be visible for all threads according to memory model (MM) Sequentially Consistent (SC) being data-race-free (DRF).
See Herb Sutter's 2013-12-23 slides p19, first box "It must be impossible for the assertion to fail – wouldn’t be SC.".

This test's threads utilize a spin-lock, waiting for their turn. Such busy cycles were chosen to simplify the test and are not recommended as they expose poor performance on a high thread-count and hence long 'working thread pipe'.

See 'test_mm_sc_drf_01' implementing same test using mutex-lock and condition wait.

Examples
test_mm_sc_drf_00.cpp.

Definition at line 60 of file test_mm_sc_drf_00.cpp.

Constructor & Destructor Documentation

◆ TestMemModelSCDRF00()

TestMemModelSCDRF00::TestMemModelSCDRF00 ( )
inline

Definition at line 154 of file test_mm_sc_drf_00.cpp.

Member Function Documentation

◆ test01_Read1Write1()

void TestMemModelSCDRF00::test01_Read1Write1 ( )
inline

Definition at line 157 of file test_mm_sc_drf_00.cpp.

◆ test02_Read2Write1()

void TestMemModelSCDRF00::test02_Read2Write1 ( )
inline

Definition at line 167 of file test_mm_sc_drf_00.cpp.

◆ test03_Read4Write1()

void TestMemModelSCDRF00::test03_Read4Write1 ( )
inline

Definition at line 191 of file test_mm_sc_drf_00.cpp.

◆ test11_Read10Write10()

void TestMemModelSCDRF00::test11_Read10Write10 ( )
inline

Definition at line 207 of file test_mm_sc_drf_00.cpp.

Here is the call graph for this function:

◆ test12_Read10Write10()

void TestMemModelSCDRF00::test12_Read10Write10 ( )
inline

Definition at line 227 of file test_mm_sc_drf_00.cpp.

Here is the call graph for this function:

◆ test_list()

void TestMemModelSCDRF00::test_list ( )
inline
Examples
test_mm_sc_drf_00.cpp.

Definition at line 247 of file test_mm_sc_drf_00.cpp.


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