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 ) privatevirtualRun 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.
Definition at line 755 of file test_mt.cpp.
Referenced by CThreadedApp::Init().
◆ TestApp_DelayedStartSyncPoint() void CThreadedApp::TestApp_DelayedStartSyncPoint ( const string & name ) protectedStart threads that belong to delayed group (this call may be ignored to provide more randomness).
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 ) protectedvirtualOverride this method to execute code after all threads terminate.
Definition at line 811 of file test_mt.cpp.
Referenced by CThreadedApp::Run().
◆ TestApp_GlobalSyncPoint() void CThreadedApp::TestApp_GlobalSyncPoint ( void ) protectedWait until ALL threads reach a call of TestApp_GlobalSyncPoint().
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 ) protectedvirtualOverride this method to execute code before running threads.
Definition at line 760 of file test_mt.cpp.
Referenced by CThreadedApp::Run().
◆ TestApp_IntraGroupSyncPoint() void CThreadedApp::TestApp_IntraGroupSyncPoint ( void ) protectedWait 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 ) virtualDestroy the thread.
Called from thread's destroy() method.
Definition at line 750 of file test_mt.cpp.
◆ Thread_Exit() bool CThreadedApp::Thread_Exit ( int idx ) virtualExit the thread.
Called from thread's OnExit() method.
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_pointTRUE, 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_threadsNumber of threads in the group.
Definition at line 134 of file test_mt.hpp.
◆ s_NumThreads unsigned int s_NumThreads extern ◆ s_SpawnByRetroSearch 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