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

test_mm_sc_drf_01: Testing SC-DRF non-atomic global read and write within a locked mutex critical block. More...

Collaboration diagram for TestMemModelSCDRF01:

Public Member Functions

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

Detailed Description

test_mm_sc_drf_01: Testing SC-DRF non-atomic global read and write within a locked mutex critical block.

Modified non-atomic memory within the locked mutex acquire and release 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.".

See 'test_mm_sc_drf_00' implementing same test using an atomic acquire/release critical block with spin-lock.

Examples
test_mm_sc_drf_01.cpp.

Definition at line 57 of file test_mm_sc_drf_01.cpp.

Constructor & Destructor Documentation

◆ TestMemModelSCDRF01()

TestMemModelSCDRF01::TestMemModelSCDRF01 ( )
inline

Definition at line 148 of file test_mm_sc_drf_01.cpp.

Member Function Documentation

◆ test01_Read1Write1()

void TestMemModelSCDRF01::test01_Read1Write1 ( )
inline

Definition at line 151 of file test_mm_sc_drf_01.cpp.

◆ test02_Read2Write1()

void TestMemModelSCDRF01::test02_Read2Write1 ( )
inline

Definition at line 161 of file test_mm_sc_drf_01.cpp.

◆ test03_Read4Write1()

void TestMemModelSCDRF01::test03_Read4Write1 ( )
inline

Definition at line 185 of file test_mm_sc_drf_01.cpp.

◆ test11_Read10Write10()

void TestMemModelSCDRF01::test11_Read10Write10 ( )
inline

Definition at line 201 of file test_mm_sc_drf_01.cpp.

Here is the call graph for this function:

◆ test12_Read10Write10()

void TestMemModelSCDRF01::test12_Read10Write10 ( )
inline

Definition at line 221 of file test_mm_sc_drf_01.cpp.

Here is the call graph for this function:

◆ test_list()

void TestMemModelSCDRF01::test_list ( )
inline
Examples
test_mm_sc_drf_01.cpp.

Definition at line 241 of file test_mm_sc_drf_01.cpp.


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