A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__MTWrappers.html below:

NCBI C++ ToolKit: MT-safety Testing Framework

◆ CThreadedApp() CThreadedApp::CThreadedApp ( void  ) ◆ Init() void CThreadedApp::Init ( void  ) privatevirtual

Initialize the app.

Reimplemented from CNcbiApplicationAPI.

Definition at line 465 of file test_mt.cpp.

References CArgDescriptions::eInteger, CNcbiApplicationAPI::GetArguments(), NStr::IntToString(), k_NumThreadsMax, k_NumThreadsMin, k_SpawnByMax, k_SpawnByMin, s_NumThreads, s_SpawnBy, CNcbiApplicationAPI::SetupArgDescriptions(), and CThreadedApp::TestApp_Args().

◆ Run() int CThreadedApp::Run ( void  ) privatevirtual

Run the threads.

Implements CNcbiApplicationAPI.

Definition at line 509 of file test_mt.cpp.

References ERR_FATAL, g(), CNcbiApplicationAPI::GetArgs(), CNcbiTest::GetRandomSeed(), i, CThreadedApp::m_Min, CThreadedApp::m_NextGroup, CThreadedApp::m_Reached, CThreadedApp::m_ThreadGroups, NCBI_PARAM_TYPE, s_NumThreads, s_SpawnBy, seed, set< Key, Compare >::size(), CTestThread::StartCascadingThreads(), t, TESTAPP_ASSERT, CThreadedApp::TestApp_Exit(), CThreadedApp::TestApp_Init(), TESTAPP_LOG_POST, thr, thr_group, CThreadedApp::x_InitializeDelayedStart(), CThreadedApp::x_InitializeThreadGroups(), CThreadedApp::x_PrintThreadGroups(), and CThreadedApp::x_StartThreadGroup().

◆ SetNumberOfDelayedStartSyncPoints() void CThreadedApp::SetNumberOfDelayedStartSyncPoints ( unsigned int  num_min, unsigned int  num_max  ) protected ◆ TestApp_Args()

Override this method to add your custom arguments.

Returns
TRUE on success, and FALSE on failure.

Definition at line 755 of file test_mt.cpp.

Referenced by CThreadedApp::Init().

◆ TestApp_DelayedStartSyncPoint() void CThreadedApp::TestApp_DelayedStartSyncPoint ( const stringname ) protected

Start threads that belong to delayed group (this call may be ignored to provide more randomness).

Note
anywhere in the middle.
Parameters
name Name can be anything you like, providing other threads use the same name. The test application distinguishes delayed-start sync points by name.

Definition at line 799 of file test_mt.cpp.

References set< Key, Compare >::end(), set< Key, Compare >::find(), set< Key, Compare >::insert(), CThreadedApp::m_AppMutex, CThreadedApp::m_Delayed, CThreadedApp::m_Reached, set< Key, Compare >::size(), and CThreadedApp::x_StartThreadGroup().

◆ TestApp_Exit() bool CThreadedApp::TestApp_Exit ( void  ) protectedvirtual

Override this method to execute code after all threads terminate.

Returns
TRUE on success, and FALSE on failure.

Definition at line 811 of file test_mt.cpp.

Referenced by CThreadedApp::Run().

◆ TestApp_GlobalSyncPoint() void CThreadedApp::TestApp_GlobalSyncPoint ( void  ) protected

Wait until ALL threads reach a call of TestApp_GlobalSyncPoint().

Warning
You can use this method if you want threads to be synchronized across different branches of code. The only thing to keep in mind is that EVERY thread has to reach TestApp_GlobalSyncPoint() for execution to be continued.
Note
Calling TestApp_GlobalSyncPoint() automatically awakes all threads that would be otherwise awaken only with TestApp_DelayedStartSyncPoint().

Definition at line 773 of file test_mt.cpp.

References i, set< Key, Compare >::insert(), CThreadedApp::m_AppMutex, CThreadedApp::m_Delayed, CThreadedApp::m_Reached, s_ThreadIdxTLS, set< Key, Compare >::size(), NStr::SizetToString(), TESTAPP_LOG_POST, thr, and CThreadedApp::x_StartThreadGroup().

◆ TestApp_Init() bool CThreadedApp::TestApp_Init ( void  ) protectedvirtual

Override this method to execute code before running threads.

Returns
TRUE on success, and FALSE on failure.

Definition at line 760 of file test_mt.cpp.

Referenced by CThreadedApp::Run().

◆ TestApp_IntraGroupSyncPoint() void CThreadedApp::TestApp_IntraGroupSyncPoint ( void  ) protected

Wait until other threads in group reach the same sync point The call may be ignored by the application.

Definition at line 766 of file test_mt.cpp.

References int, s_ThreadIdxTLS, and thr.

◆ Thread_Destroy() bool CThreadedApp::Thread_Destroy ( int  idx ) virtual

Destroy the thread.

Called from thread's destroy() method.

Returns
TRUE on success, and FALSE on failure.

Definition at line 750 of file test_mt.cpp.

◆ Thread_Exit() bool CThreadedApp::Thread_Exit ( int  idx ) virtual

Exit the thread.

Called from thread's OnExit() method.

Returns
TRUE on success, and FALSE on failure.

Definition at line 744 of file test_mt.cpp.

Referenced by CTestThread::OnExit().

◆ Thread_Init() bool CThreadedApp::Thread_Init ( int  idx ) virtual ◆ Thread_Run() bool CThreadedApp::Thread_Run ( int  idx ) virtual ◆ x_InitializeDelayedStart() unsigned int CThreadedApp::x_InitializeDelayedStart ( void  ) private ◆ x_InitializeThreadGroups() void CThreadedApp::x_InitializeThreadGroups ( void  ) private ◆ x_PrintThreadGroups() void CThreadedApp::x_PrintThreadGroups ( void  ) private ◆ x_StartThreadGroup() void CThreadedApp::x_StartThreadGroup ( unsigned int  count ) private ◆ ~CThreadedApp() CThreadedApp::~CThreadedApp ( void  ) ◆ has_sync_point bool CThreadedApp::SThreadGroup::has_sync_point

TRUE, if the group has intra-group sync point.

Definition at line 136 of file test_mt.hpp.

◆ k_NumThreadsMax const unsigned int k_NumThreadsMax = 500 ◆ k_NumThreadsMin ◆ k_SpawnByMax ◆ k_SpawnByMin ◆ m_AppMutex ◆ m_Delayed vector<unsigned int> CThreadedApp::m_Delayed private ◆ m_LogMsgCount unsigned int CThreadedApp::m_LogMsgCount protected ◆ m_Max unsigned int CThreadedApp::m_Max private ◆ m_Min unsigned int CThreadedApp::m_Min private ◆ m_NextGroup atomic<unsigned int> CThreadedApp::m_NextGroup private ◆ m_Reached ◆ m_ThreadGroups ◆ number_of_threads unsigned int CThreadedApp::SThreadGroup::number_of_threads

Number of threads in the group.

Definition at line 134 of file test_mt.hpp.

◆ s_NumThreads unsigned int s_NumThreads extern ◆ s_SpawnBy

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4