NCBI C++ ToolKit
Functions | Variables
threads_man.cpp File Reference
#include "task_server_pch.hpp"
#include <corelib/ncbireg.hpp>
#include "threads_man.hpp"
#include "timers.hpp"
#include "sockets_man.hpp"
#include "memory_man.hpp"
#include "logging.hpp"
#include "time_man.hpp"
#include "server_core.hpp"
#include "rcu.hpp"
#include "scheduler.hpp"
#include "srv_stat.hpp"
+ Include dependency graph for threads_man.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

SSrvThreadGetCurThread (void)
 
TSrvThreadNum GetCntRunningThreads (void)
 
static void s_SetCurThread (SSrvThread *thr)
 
static void s_RegisterNewThread (SSrvThread *thr)
 
static void s_PerJiffyTasks_Main (SSrvThread *thr)
 
static void s_PerJiffyTasks_Service (SSrvThread *thr)
 
static void s_PerJiffyTasks_Worker (SSrvThread *thr)
 
static SSrvThreads_AllocThread (TSrvThreadNum thread_num)
 
static void * s_WorkerThreadMain (void *data)
 
static bool s_StartThread (SSrvThread *thr, void *(*thr_func)(void *))
 
static void s_StopCurMgrThread (void)
 
static void s_StartCurMgrThread (void)
 
static void * s_ServiceThreadMain (void *)
 
void RequestThreadStart (SSrvThread *thr)
 
void RequestThreadStop (SSrvThread *thr)
 
void RequestThreadRevive (SSrvThread *thr)
 
static bool s_StartAllThreads (void)
 
static void s_JoinAllThreads (void)
 
void InitCurThreadStorage (void)
 
void ConfigureThreads (const CNcbiRegistry *reg, CTempString section)
 
bool ReConfig_Threads (const CTempString &, const CNcbiRegistry &, string &)
 
void WriteSetup_Threads (CSrvSocketTask &task)
 
bool InitThreadsMan (void)
 
void RunMainThread (void)
 
void FinalizeThreadsMan (void)
 

Variables

static const TSrvThreadNum kMaxNumberOfThreads = numeric_limits<TSrvThreadNum>::max() - 2
 
SSrvThread ** s_Threads = NULL
 
static CMiniMutex s_ThrMgrLock
 
static EThreadMgrState s_ThreadMgrState = eThrMgrIdle
 
static SSrvThreads_CurMgrThread = NULL
 
static SSrvThreads_MainThr = NULL
 
static SSrvThreads_SvcThr = NULL
 
static CFutex s_SvcSignal
 
TSrvThreadNum s_MaxRunningThreads = 20
 
Uint8 s_CurJiffies
 
CSrvTime s_JiffyTime
 
string s_AppBaseName
 

Function Documentation

◆ ConfigureThreads()

void ConfigureThreads ( const CNcbiRegistry reg,
CTempString  section 
)

Definition at line 443 of file threads_man.cpp.

References IRegistry::GetInt(), kMaxNumberOfThreads, and s_MaxRunningThreads.

Referenced by s_ReadConfiguration().

◆ FinalizeThreadsMan()

void FinalizeThreadsMan ( void  )

Definition at line 497 of file threads_man.cpp.

Referenced by CTaskServer::Finalize().

◆ GetCntRunningThreads()

TSrvThreadNum GetCntRunningThreads ( void  )

Definition at line 102 of file threads_man.cpp.

References i, IsThreadRunning(), result, s_MaxRunningThreads, and s_Threads.

Referenced by s_DoFatalAbort(), and s_SaveState().

◆ GetCurThread()

SSrvThread* GetCurThread ( void  )

◆ InitCurThreadStorage()

void InitCurThreadStorage ( void  )

Definition at line 431 of file threads_man.cpp.

References NULL, and SRV_FATAL.

Referenced by s_LowLevelInit().

◆ InitThreadsMan()

bool InitThreadsMan ( void  )

◆ ReConfig_Threads()

bool ReConfig_Threads ( const CTempString section,
const CNcbiRegistry new_reg,
string err_message 
)

Definition at line 450 of file threads_man.cpp.

Referenced by CTaskServer::ReConfig().

◆ RequestThreadRevive()

void RequestThreadRevive ( SSrvThread thr)

◆ RequestThreadStart()

void RequestThreadStart ( SSrvThread thr)

◆ RequestThreadStop()

void RequestThreadStop ( SSrvThread thr)

◆ RunMainThread()

void RunMainThread ( void  )

◆ s_AllocThread()

static SSrvThread* s_AllocThread ( TSrvThreadNum  thread_num)
static

◆ s_JoinAllThreads()

static void s_JoinAllThreads ( void  )
static

◆ s_PerJiffyTasks_Main()

static void s_PerJiffyTasks_Main ( SSrvThread thr)
static

◆ s_PerJiffyTasks_Service()

static void s_PerJiffyTasks_Service ( SSrvThread thr)
static

◆ s_PerJiffyTasks_Worker()

static void s_PerJiffyTasks_Worker ( SSrvThread thr)
static

◆ s_RegisterNewThread()

static void s_RegisterNewThread ( SSrvThread thr)
static

◆ s_ServiceThreadMain()

static void* s_ServiceThreadMain ( void *  )
static

◆ s_SetCurThread()

static void s_SetCurThread ( SSrvThread thr)
static

Definition at line 113 of file threads_man.cpp.

References buf, eThreadDormant, s_AppBaseName, and thr.

Referenced by InitThreadsMan(), s_RegisterNewThread(), and s_ServiceThreadMain().

◆ s_StartAllThreads()

static bool s_StartAllThreads ( void  )
static

◆ s_StartCurMgrThread()

static void s_StartCurMgrThread ( void  )
static

◆ s_StartThread()

static bool s_StartThread ( SSrvThread thr,
void *(*)(void *)  thr_func 
)
static

Definition at line 264 of file threads_man.cpp.

References Critical(), NULL, SRV_LOG, and thr.

Referenced by s_StartAllThreads(), and s_StartCurMgrThread().

◆ s_StopCurMgrThread()

static void s_StopCurMgrThread ( void  )
static

◆ s_WorkerThreadMain()

static void* s_WorkerThreadMain ( void *  data)
static

◆ WriteSetup_Threads()

void WriteSetup_Threads ( CSrvSocketTask task)

Variable Documentation

◆ kMaxNumberOfThreads

const TSrvThreadNum kMaxNumberOfThreads = numeric_limits<TSrvThreadNum>::max() - 2
static

Definition at line 55 of file threads_man.cpp.

Referenced by ConfigureThreads().

◆ s_AppBaseName

string s_AppBaseName
extern

Definition at line 77 of file server_core.cpp.

Referenced by GetConfName(), s_LoadConfFile(), s_ProcessParameters(), and s_SetCurThread().

◆ s_CurJiffies

Uint8 s_CurJiffies
extern

◆ s_CurMgrThread

SSrvThread* s_CurMgrThread = NULL
static

◆ s_JiffyTime

CSrvTime s_JiffyTime
extern

Definition at line 54 of file time_man.cpp.

Referenced by ConfigureTimeMan(), s_ServiceThreadMain(), and WriteSetup_TimeMan().

◆ s_MainThr

SSrvThread* s_MainThr = NULL
static

Definition at line 63 of file threads_man.cpp.

Referenced by InitThreadsMan(), RunMainThread(), and s_JoinAllThreads().

◆ s_MaxRunningThreads

TSrvThreadNum s_MaxRunningThreads = 20

◆ s_SvcSignal

CFutex s_SvcSignal
static

Definition at line 69 of file threads_man.cpp.

Referenced by s_ServiceThreadMain().

◆ s_SvcThr

SSrvThread* s_SvcThr = NULL
static

◆ s_ThreadMgrState

EThreadMgrState s_ThreadMgrState = eThrMgrIdle
static

◆ s_Threads

SSrvThread** s_Threads = NULL

◆ s_ThrMgrLock

CMiniMutex s_ThrMgrLock
static
Modified on Fri Sep 20 14:58:30 2024 by modify_doxy.py rev. 669887