Every request has an associated 32-bit priority field, but only the top eight bits are under direct user control.
(The rest are a counter.)
Definition at line 81 of file thread_pool_old.hpp.
◆ TPriority [2/2] ◆ TQueue [1/2] ◆ TQueue [2/2] ◆ TQueuePredicate ◆ TRealQueue [1/2] ◆ TRealQueue [2/2]template<typename TRequest >
◆ TRequest [1/3] ◆ TRequest [2/3] ◆ TRequest [3/3] ◆ TThread [1/4] ◆ TThread [2/4] ◆ TThread [3/4] ◆ TThread [4/4] ◆ TThreads [1/2] ◆ TThreads [2/2] ◆ TUserPriority [1/3] ◆ TUserPriority [2/3] ◆ TUserPriority [3/3] ◆ EErrCode Enumerator eControllerBusyattempt to create several ThreadPools with the same controller
eTaskBusyattempt to change task when it's already placed into ThreadPool or to put task in ThreadPool several times
eProhibitedattempt to do something when ThreadPool was already aborted or to add task when it is prohibited by flags of exclusive execution
eInactiveattempt to call active methods in ThreadPool_Controller when it is not attached to any ThreadPool
eInvalidattempt to operate task added in one ThreadPool by means of methods of another ThreadPool or invalid parameters in the constructor
Definition at line 606 of file thread_pool.hpp.
◆ EEventEvents that can happen with ThreadPool.
Enumerator eSuspendThreadPool is suspended for exclusive task execution.
eResumeThreadPool is resumed after exclusive task execution.
eOtherAll other events (happen asynchronously, so cannot be further distinguished)
Definition at line 513 of file thread_pool.hpp.
◆ EExclusiveFlagsBinary flags indicating different possible options in what environment the pool will execute exclusive task.
Do not allow to add new tasks to the pool during exclusive task execution.
fFlushThreadsFinish all threads currently running in the pool.
fCancelExecutingTasksCancel all currently executing tasks.
fCancelQueuedTasksCancel all tasks waiting in the queue and not yet executing.
fExecuteQueuedTasksExecute all tasks waiting in the queue before execution of exclusive task.
Definition at line 333 of file thread_pool.hpp.
◆ EFlushTypeWhen to start new threads after flushing old ones.
New threads can be started immediately.
eWaitToFinishNew threads can be started only when all old threads finished their execution.
Definition at line 381 of file thread_pool.hpp.
◆ EKillFlags Enumerator fKill_WaitWait for all threads in the pool to finish.
fKill_ReopenAllow a fresh batch of worker threads.
Definition at line 633 of file thread_pool_old.hpp.
◆ ERunModetemplate<typename TRequest >
Thread run mode.
Enumerator eNormalProcess request and stay in the pool.
eRunOnceProcess request and die.
Definition at line 314 of file thread_pool_old.hpp.
◆ EStatus [1/2]Status of the task.
Enumerator eIdlehas not been placed in queue yet
eQueuedin the queue, awaiting execution
eExecutingbeing executed
eCompletedexecuted successfully
eFailedfailure during execution
eCanceledcanceled - possible only if canceled before processing was started or if method Execute() returns result eCanceled
Definition at line 79 of file thread_pool.hpp.
◆ EStatus [2/2] Enumerator ePendingstill in the queue
eActiveextracted but not yet released
eCompleteextracted and released
eWithdrawndropped by submitter's request
eForciblyCaughtlet an exception escape
Definition at line 70 of file thread_pool_old.hpp.
◆ Abort() ◆ AcceptRequest() [1/2] void CPoolOfThreads_ForServer::AcceptRequest ( const TRequest & request ) ◆ AcceptRequest() [2/2]template<typename TRequest >
◆ AcceptUrgentRequest()template<typename TRequest >
Puts a request in the queue with the highest priority It will run a new thread even if the maximum of allowed threads has been already reached.
Definition at line 1104 of file thread_pool_old.hpp.
◆ AddTask() ◆ CancelTask() ◆ CancelTasks() ◆ CAutoUnregGuard() [1/2] CThreadInPool_ForServer::CAutoUnregGuard::CAutoUnregGuard ( TThread * thr )Definition at line 154 of file server.cpp.
◆ CAutoUnregGuard() [2/2] ◆ CBlockingQueue() [1/2]template<typename TRequest >
forbidden
◆ CBlockingQueue() [2/2]template<typename TRequest >
Constructor.
Definition at line 142 of file thread_pool_old.hpp.
◆ CBlockingQueue_ForServer() [1/2] ◆ CBlockingQueue_ForServer() [2/2] CBlockingQueue_ForServer::CBlockingQueue_ForServer ( void ) inline ◆ CCompletingHandle() [1/2] ◆ CCompletingHandle() [2/2] ◆ CountSelf() [1/2]template<typename TRequest >
◆ CountSelf() [2/2] void CThreadInPool_ForServer::CountSelf ( void ) ◆ CPoolOfThreads()template<typename TRequest >
Constructor.
Definition at line 1055 of file thread_pool_old.hpp.
◆ CPoolOfThreads_ForServer() CPoolOfThreads_ForServer::CPoolOfThreads_ForServer ( unsigned int max_threads, const string & thr_suffix ) ◆ CQueueItem() [1/2] ◆ CQueueItem() [2/2] ◆ CQueueItemBase() ◆ CQueueItemBase_ForServer() ◆ CreateThread() ◆ CStdPoolOfThreads() CStdPoolOfThreads::CStdPoolOfThreads ( unsigned int max_threads, unsigned int queue_size, unsigned int spawn_threshold =1
, unsigned int max_urgent_threads = kMax_UInt
, const string & thread_name = kEmptyStr
) inline
Constructor.
Definition at line 623 of file thread_pool_old.hpp.
◆ CStdThreadInPool()Constructor.
Definition at line 586 of file thread_pool_old.hpp.
◆ CThreadInPool()template<typename TRequest >
Constructor.
Definition at line 325 of file thread_pool_old.hpp.
◆ CThreadInPool_ForServer() CThreadInPool_ForServer::CThreadInPool_ForServer ( TPool * pool ) inlineConstructor.
Definition at line 166 of file thread_pool_for_server.hpp.
◆ CThreadPool() [1/3]Prohibit copying and assigning.
◆ CThreadPool() [2/3]Constructor with custom controller.
Definition at line 2187 of file thread_pool.cpp.
References CThreadPool::CThreadPool_Impl, CThreadPool::m_Impl, and CThreadPool_Impl::SetInterfaceStarted().
◆ CThreadPool() [3/3]Constructor.
Definition at line 2177 of file thread_pool.cpp.
References CThreadPool::CThreadPool_Impl, CThreadPool::m_Impl, and CThreadPool_Impl::SetInterfaceStarted().
◆ CThreadPool_Controller() [1/2]Prohibit copying and assigning.
◆ CThreadPool_Controller() [2/2] CThreadPool_Controller::CThreadPool_Controller ( unsigned int max_threads, unsigned int min_threads )Constructor.
Definition at line 1995 of file thread_pool.cpp.
References NCBI_THROW_FMT.
◆ CThreadPool_Controller_PID() CThreadPool_Controller_PID::CThreadPool_Controller_PID ( unsigned int max_threads, unsigned int min_threads ) ◆ CThreadPool_Task() [1/2] ◆ CThreadPool_Task() [2/2] CThreadPool_Task::CThreadPool_Task ( unsigned int priority =0
) ◆ CThreadPool_Thread() [1/2]
Prohibit copying and assigning.
◆ CThreadPool_Thread() [2/2] CThreadPool_Thread::CThreadPool_Thread ( CThreadPool * pool ) protected ◆ EnsureLimits() void CThreadPool_Controller::EnsureLimits ( void ) protected ◆ Execute() virtual EStatus CThreadPool_Task::Execute ( void ) pure virtualDo the actual job.
Called by whichever thread handles this task.
Implemented in SAsyncWriteTask, CWGSThreadPoolTask_GetChunk, CWGSThreadPoolTask_GetBlobByBlobId, CWGSThreadPoolTask_GetBlobBySeqId, CWGSThreadPoolTask_ResolveSeqId, CSNPThreadPoolTask_GetAnnotation, CSNPThreadPoolTask_GetChunk, CSNPThreadPoolTask_GetBlobByBlobId, CCDDThreadPoolTask_GetBlobByBlobId, CCDDThreadPoolTask_GetBlobBySeqId, CCDDThreadPoolTask_GetBlobId, CThreadPool_EmptyTask, CCreateCoverageTask, CPrefetchRequest, CThreadPoolEngine::CThreadTask, and CPSGL_RequestTracker::CBackgroundTask.
Referenced by CThreadPool_ThreadImpl::Main(), and CThreadPool_ServiceThread::Main().
◆ Finalize() void CThreadPool_Thread::Finalize ( void ) protectedvirtual ◆ FlushThreads() void CThreadPool::FlushThreads ( EFlushType flush_type ) ◆ Get()template<typename TRequest >
Get the first available request from the queue, and return just the request.
Blocks politely if empty. Waits up to timeout_sec + timeout_nsec/1E9 seconds.
Definition at line 815 of file thread_pool_old.hpp.
◆ GetChangeCalcTime() double CThreadPool_Controller_PID::GetChangeCalcTime ( void ) inline ◆ GetChangePredictTime() double CThreadPool_Controller_PID::GetChangePredictTime ( void ) inline ◆ GetCurrentTask() ◆ GetDestroyTimeout()Get timeout to wait for all threads to finish before the pool will be able to destroy.
Definition at line 2243 of file thread_pool.cpp.
References CThreadPool_Impl::GetDestroyTimeout(), and CThreadPool::m_Impl.
◆ GetErrCodeString() const char * CThreadPoolException::GetErrCodeString ( void ) const overridevirtual ◆ GetExecutingTasksCount() unsigned int CThreadPool::GetExecutingTasksCount ( void ) const ◆ GetHandle() [1/3]template<typename TRequest >
Get the first available request from the queue, and return a handle to it.
Blocks politely if empty. Waits up to timeout_sec + timeout_nsec/1E9 seconds.
Definition at line 767 of file thread_pool_old.hpp.
References _VERIFY, set< Key, Compare >::begin(), set< Key, Compare >::empty(), set< Key, Compare >::erase(), NCBI_THROW, ok, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), set< Key, Compare >::size(), and CBlockingQueue< TRequest >::x_GetSemPred().
Referenced by CSeqFetchQueue::Clear(), and CThreadInPool< TRequest >::x_HandleOneRequest().
◆ GetHandle() [2/3] ◆ GetHandle() [3/3] ◆ GetHunger()template<typename TRequest >
Get the number of threads waiting for requests, for debugging purposes only.
Definition at line 229 of file thread_pool_old.hpp.
◆ GetMainPoolMutex() [1/2] ◆ GetMainPoolMutex() [2/2] CMutex & CThreadPool::GetMainPoolMutex ( void ) protected ◆ GetMaxSize()template<typename TRequest >
◆ GetMaxThreads() unsigned int CThreadPool_Controller::GetMaxThreads ( void ) const inline ◆ GetMinThreads() unsigned int CThreadPool_Controller::GetMinThreads ( void ) const inline ◆ GetPool() [1/3] ◆ GetPool() [2/3] CThreadPool * CThreadPool_Thread::GetPool ( void ) const protected ◆ GetPool() [3/3] CThreadPool * CThreadPool_Controller::GetPool ( void ) const protected ◆ GetPriority() [1/2] unsigned int CThreadPool_Task::GetPriority ( void ) const inline ◆ GetPriority() [2/2] ◆ GetQueuedTasksCount() unsigned int CThreadPool::GetQueuedTasksCount ( void ) const ◆ GetQueuedTasksThreshold() double CThreadPool_Controller_PID::GetQueuedTasksThreshold ( void ) inline ◆ GetQueueSize()template<typename TRequest >
◆ GetRequest() [1/2] const TRequest& CBlockingQueue_ForServer::CQueueItem::GetRequest ( void ) const inline ◆ GetRequest() [2/2] ◆ GetRunMode()template<typename TRequest >
◆ GetSafeSleepTime() [1/2] CTimeSpan CThreadPool_Controller::GetSafeSleepTime ( void ) const virtual ◆ GetSafeSleepTime() [2/2] CTimeSpan CThreadPool_Controller_PID::GetSafeSleepTime ( void ) const virtual ◆ GetSize()template<typename TRequest >
◆ GetStatus() [1/3] const EStatus& CQueueItemBase_ForServer::GetStatus ( void ) const inline ◆ GetStatus() [2/3] ◆ GetStatus() [3/3] ◆ GetTaskMaxQueuedTime() double CThreadPool_Controller_PID::GetTaskMaxQueuedTime ( void ) inline ◆ GetThreadsCount() unsigned int CThreadPool::GetThreadsCount ( void ) const ◆ GetUserPriority() ◆ HandleEvent() void CThreadPool_Controller::HandleEvent ( EEvent event ) ◆ HasImmediateRoom()template<typename TRequest >
◆ Init()template<typename TRequest >
◆ Initialize() void CThreadPool_Thread::Initialize ( void ) protectedvirtual ◆ IsAborted() bool CThreadPool::IsAborted ( void ) const ◆ IsCancelRequested() bool CThreadPool_Task::IsCancelRequested ( void ) const inline ◆ IsEmpty() [1/2]template<typename TRequest >
◆ IsEmpty() [2/2]template<typename TRequest >
◆ IsFinished() bool CThreadPool_Task::IsFinished ( void ) const inline ◆ IsFull() [1/2]template<typename TRequest >
◆ IsFull() [2/2]template<typename TRequest >
◆ KillAllThreads() [1/3] void CPoolOfThreads_ForServer::KillAllThreads ( bool wait ) ◆ KillAllThreads() [2/3] virtual void CStdPoolOfThreads::KillAllThreads ( bool wait ) inlinevirtual ◆ KillAllThreads() [3/3] void CStdPoolOfThreads::KillAllThreads ( TKillFlags flags ) virtualCauses all threads in the pool to exit cleanly after finishing all pending requests, optionally waiting for them to die.
Definition at line 51 of file thread_pool_old.cpp.
References CPoolOfThreads< CRef< CStdRequest > >::AcceptRequest(), ERR_POST, CStdPoolOfThreads::fKill_Reopen, CStdPoolOfThreads::fKill_Wait, flags, CAtomicCounter::Get(), i, CPoolOfThreads< CRef< CStdRequest > >::m_MaxThreads, CPoolOfThreads< CRef< CStdRequest > >::m_Mutex, CPoolOfThreads< CRef< CStdRequest > >::m_QueuingForbidden, CPoolOfThreads< CRef< CStdRequest > >::m_ThreadCount, CStdPoolOfThreads::m_Threads, n, NON_CONST_ITERATE, CAtomicCounter::Set(), CPoolOfThreads< CRef< CStdRequest > >::WaitForRoom(), and Warning().
Referenced by CSeqFetchQueue::Finish(), CStdPoolOfThreads::KillAllThreads(), SGridWorkerNodeImpl::x_StopWorkerThreads(), and CStdPoolOfThreads::~CStdPoolOfThreads().
◆ Main() [1/3] void * CThreadInPool_ForServer::Main ( void ) privatevirtual ◆ Main() [2/3] void * CThreadPool_Thread::Main ( void ) privatevirtual ◆ Main() [3/3]template<typename TRequest >
Derived (user-created) class must provide a real thread function.
Implements CThread.
Definition at line 1003 of file thread_pool_old.hpp.
References _ASSERT, ERR_POST, CThreadInPool< TRequest >::eRunOnce, CThreadInPool< TRequest >::Init(), CThreadInPool< TRequest >::m_Pool, CThreadInPool< TRequest >::m_RunMode, CPoolOfThreads< TRequest >::m_ThreadName, CPoolOfThreads< TRequest >::Register(), CThread::SetCurrentThreadName(), Warning(), and CThreadInPool< TRequest >::x_HandleOneRequest().
◆ MarkAsComplete() [1/2] void CQueueItemBase_ForServer::MarkAsComplete ( void ) inline ◆ MarkAsComplete() [2/2] void CQueueItemBase::MarkAsComplete ( void ) inline ◆ MarkAsForciblyCaught() [1/2] void CQueueItemBase_ForServer::MarkAsForciblyCaught ( void ) inline ◆ MarkAsForciblyCaught() [2/2] void CQueueItemBase::MarkAsForciblyCaught ( void ) inline ◆ NCBI_EXCEPTION_DEFAULT() ◆ NCBI_PARAM_DECL() NCBI_PARAM_DECL ( bool , ThreadPool , Catch_Unhandled_Exceptions ) ◆ NCBI_PARAM_TYPE() typedef NCBI_PARAM_TYPE ( ThreadPool , Catch_Unhandled_Exceptions ) ◆ NewThread() [1/3]template<typename TRequest >
Create a new thread.
Implemented in CStdPoolOfThreads.
◆ NewThread() [2/3] ◆ NewThread() [3/3] TThread* CPoolOfThreads_ForServer::NewThread ( void ) inlineprivate ◆ OnCancelRequested() void CThreadPool_Task::OnCancelRequested ( void ) protectedvirtual ◆ OnEvent() [1/2] void CThreadPool_Controller_PID::OnEvent ( EEvent event ) protectedvirtualMain method for implementation of controlling algorithm.
Implements CThreadPool_Controller.
Definition at line 57 of file thread_pool_ctrl.cpp.
References CStopWatch::Elapsed(), CThreadPool_Controller::EnsureLimits(), CThreadPool_Controller::eResume, CThreadPool_Controller::eSuspend, CThreadPool::GetExecutingTasksCount(), CThreadPool_Controller::GetMaxThreads(), CThreadPool_Controller::GetMinThreads(), CThreadPool_Controller::GetPool(), CThreadPool::GetQueuedTasksCount(), CThreadPool::GetThreadsCount(), CThreadPool_Controller_PID::m_DerivCoeff, CThreadPool_Controller_PID::m_DerivTime, CThreadPool_Controller_PID::m_ErrHistory, CThreadPool_Controller_PID::m_IntegrCoeff, CThreadPool_Controller_PID::m_IntegrErr, CThreadPool_Controller_PID::m_Threshold, CThreadPool_Controller_PID::m_Timer, and CThreadPool_Controller::SetThreadsCount().
◆ OnEvent() [2/2] virtual void CThreadPool_Controller::OnEvent ( EEvent event ) protectedpure virtual ◆ OnExit() [1/2] void CThreadPool_Thread::OnExit ( void ) privatevirtual ◆ OnExit() [2/2]template<typename TRequest >
◆ OnStatusChange() [1/2] void CThreadPool_Task::OnStatusChange ( EStatus old ) protectedvirtual ◆ OnStatusChange() [2/2] ◆ operator()() ◆ operator=() [1/6]template<typename TRequest >
◆ operator=() [2/6] ◆ operator=() [3/6] ◆ operator=() [4/6] ◆ operator=() [5/6] ◆ operator=() [6/6] ◆ operator>() ◆ Process() virtual void CStdRequest::Process ( void ) pure virtual ◆ ProcessRequest() [1/6] ◆ ProcessRequest() [2/6] void CThreadInPool_ForServer::ProcessRequest ( const TRequest & req ) inlineprotected ◆ ProcessRequest() [3/6]template<typename TRequest >
Older interface (still delegated to by default)
Implemented in CStdThreadInPool.
◆ ProcessRequest() [4/6] void CThreadInPool_ForServer::ProcessRequest ( TItemHandle handle ) protected ◆ ProcessRequest() [5/6]template<typename TRequest >
◆ ProcessRequest() [6/6] virtual void CStdThreadInPool::ProcessRequest ( TItemHandle handle ) inlineprotectedvirtual ◆ Put() [1/2] ◆ Put() [2/2]template<typename TRequest >
◆ Register() [1/3] bool CPoolOfThreads_ForServer::Register ( TThread & thread ) private ◆ Register() [2/3]template<typename TRequest >
◆ Register() [3/3] void CStdPoolOfThreads::Register ( TThread & thread ) virtual ◆ RequestExclusiveExecution()Add the task for exclusive execution in the pool By default the pool suspends all new and queued tasks processing, finishes execution of all currently executing tasks and then executes exclusive task in special thread devoted to this work.
The environment in which exclusive task executes can be modified by flags parameter. This method does not wait for exclusive execution, it is just adds the task to exclusive queue and starts the process of exclusive environment preparation. If next exclusive task will be added before preveous finishes (or even starts) its execution then they will be executed consequently each in its own exclusive environment (if flags parameter for them is different).
Definition at line 2249 of file thread_pool.cpp.
References flags, CThreadPool::m_Impl, and CThreadPool_Impl::RequestExclusiveExecution().
◆ RequestToCancel() void CThreadPool_Task::RequestToCancel ( void ) ◆ SetChangeCalcTime() void CThreadPool_Controller_PID::SetChangeCalcTime ( double calc_time ) inlineSet the time period (in seconds) for which average speed of changing of waiting tasks number is calculated.
Average speed is calculated by simple division of changing in waiting tasks number during this time period per time period value (all counts of tasks are calculated per each thread). By default parameter is set to 0.3.
Definition at line 211 of file thread_pool_ctrl.hpp.
References CThreadPool_Controller_PID::m_DerivTime.
◆ SetChangePredictTime() void CThreadPool_Controller_PID::SetChangePredictTime ( double predict_time ) inlineSet period of prediction of number of tasks in queue The meaning of parameter is only approximate.
In fact it is the coefficient in derivative part of the algorithm. Meaning of the coefficient is like this: take average speed of changing of tasks count, multiply it by this prediction time, if the resulting value is greater than threshold then new thread is needed. By default parameter is set to 0.5.
Definition at line 223 of file thread_pool_ctrl.hpp.
References CThreadPool_Controller_PID::m_DerivCoeff.
◆ SetDestroyTimeout() ◆ SetMaxThreads() void CThreadPool_Controller::SetMaxThreads ( unsigned int max_threads ) ◆ SetMinThreads() void CThreadPool_Controller::SetMinThreads ( unsigned int min_threads ) ◆ SetQueuedTasksThreshold() void CThreadPool_Controller_PID::SetQueuedTasksThreshold ( double threshold ) inlineSet maximum number of tasks in queue per each thread The meaning of parameter is only approximate.
In fact it is the coefficient in proportional part of the algorithm and adjustment for all other coefficients. By default parameter is set to 3.
Definition at line 187 of file thread_pool_ctrl.hpp.
References CThreadPool_Controller_PID::m_Threshold.
◆ SetRequest() ◆ SetTaskMaxQueuedTime() void CThreadPool_Controller_PID::SetTaskMaxQueuedTime ( double queued_time ) inlineSet maximum time (in seconds) that task can wait in queue for processing until new thread will be launched.
The meaning of parameter is only approximate. In fact it is the coefficient in integral part of the algorithm and effectively if only one task will be considered then coefficient will be multiplied by number of currently running threads and currently set threshold. By default parameter is set to 0.2.
Definition at line 199 of file thread_pool_ctrl.hpp.
References CThreadPool_Controller_PID::m_IntegrCoeff.
◆ SetThreadsCount() void CThreadPool_Controller::SetThreadsCount ( unsigned int count ) protected ◆ SetUserPriority() [1/2]template<typename TRequest >
◆ SetUserPriority() [2/2]template<typename TRequest >
◆ Spawn() [1/2] void CPoolOfThreads_ForServer::Spawn ( unsigned int num_threads ) ◆ Spawn() [2/2]template<typename TRequest >
◆ SThreadPool_PID_ErrInfo() SThreadPool_PID_ErrInfo::SThreadPool_PID_ErrInfo ( double time_, double err_ ) inlineDefinition at line 64 of file thread_pool_ctrl.hpp.
◆ UnRegister() [1/3] void CPoolOfThreads_ForServer::UnRegister ( TThread & thread ) private ◆ UnRegister() [2/3]template<typename TRequest >
◆ UnRegister() [3/3] void CStdPoolOfThreads::UnRegister ( TThread & thread ) virtual ◆ WaitForHunger()template<typename TRequest >
◆ WaitForRoom() [1/2]template<typename TRequest >
◆ WaitForRoom() [2/2]template<typename TRequest >
◆ Withdraw() [1/2]template<typename TRequest >
◆ Withdraw() [2/2]template<typename TRequest >
◆ x_AcceptRequest()template<typename TRequest >
◆ x_AttachToPool() ◆ x_DetachFromPool() void CThreadPool_Controller::x_DetachFromPool ( void ) inlineprivate ◆ x_GetSemPred()template<typename TRequest >
◆ x_HandleOneRequest() [1/2] void CThreadInPool_ForServer::x_HandleOneRequest ( bool catch_all ) private ◆ x_HandleOneRequest() [2/2]template<typename TRequest >
◆ x_HungerSemPred()template<typename TRequest >
◆ x_Init() void CThreadPool_Task::x_Init ( unsigned int priority ) private ◆ x_OnExit()template<typename TRequest >
◆ x_PutSemPred()template<typename TRequest >
◆ x_RequestToCancel() void CThreadPool_Task::x_RequestToCancel ( void ) inlineprivate ◆ x_ResetOwner() void CThreadPool_Task::x_ResetOwner ( void ) inlineprivate ◆ x_RunNewThread()template<typename TRequest >
◆ x_SetOwner() ◆ x_SetStatus() [1/5] virtual void CQueueItemBase_ForServer::x_SetStatus ( EStatus new_status ) inlineprotectedvirtual ◆ x_SetStatus() [2/5] void CBlockingQueue_ForServer::CQueueItem::x_SetStatus ( EStatus new_status ) inlineprotected ◆ x_SetStatus() [3/5] void CThreadPool_Task::x_SetStatus ( EStatus new_status ) private ◆ x_SetStatus() [4/5] virtual void CQueueItemBase::x_SetStatus ( EStatus new_status ) inlineprotectedvirtual ◆ x_SetStatus() [5/5] ◆ x_UnregisterThread() [1/2] void CThreadInPool_ForServer::x_UnregisterThread ( void ) private ◆ x_UnregisterThread() [2/2]template<typename TRequest >
◆ x_WaitForPredicate()template<typename TRequest >
Definition at line 884 of file thread_pool_old.hpp.
References CurrentTime(), CTime::eCurrent, CTime::eGmt, ePositive, CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), CGuard< Resource, Lock, Unlock, ReportExceptions >::Guard(), kMax_Int, kNanoSecondsPerSecond, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), and CSemaphore::TryWait().
◆ ~CAutoUnregGuard() [1/2] CThreadInPool_ForServer::CAutoUnregGuard::~CAutoUnregGuard ( void )Definition at line 159 of file server.cpp.
◆ ~CAutoUnregGuard() [2/2] ◆ ~CCompletingHandle() [1/2] CBlockingQueue_ForServer::CCompletingHandle::~CCompletingHandle ( ) inline ◆ ~CCompletingHandle() [2/2] ◆ ~CPoolOfThreads()template<typename TRequest >
◆ ~CPoolOfThreads_ForServer() CPoolOfThreads_ForServer::~CPoolOfThreads_ForServer ( void ) virtual ◆ ~CStdPoolOfThreads() CStdPoolOfThreads::~CStdPoolOfThreads ( ) virtual ◆ ~CStdRequest() virtual CStdRequest::~CStdRequest ( void ) inlinevirtual ◆ ~CThreadInPool()template<typename TRequest >
◆ ~CThreadInPool_ForServer() CThreadInPool_ForServer::~CThreadInPool_ForServer ( void ) protectedvirtual ◆ ~CThreadPool() CThreadPool::~CThreadPool ( void ) virtualDestructor – will wait for all its threads to finish with the timeout set by CThreadPool::SetDestroyTimeout(); current default is 10 seconds.
If this timeout is not enough for threads to terminate CThreadPool will be destroyed but all threads will finish later without any "segmentation fault" errors because CThreadPool_Impl object will remain in memory until all its threads finish.
Definition at line 2195 of file thread_pool.cpp.
References CThreadPool_Impl::DestroyReference(), and CThreadPool::m_Impl.
◆ ~CThreadPool_Controller() CThreadPool_Controller::~CThreadPool_Controller ( void ) protectedvirtual ◆ ~CThreadPool_Task() CThreadPool_Task::~CThreadPool_Task ( void ) protectedvirtual ◆ ~CThreadPool_Thread() CThreadPool_Thread::~CThreadPool_Thread ( void ) protectedvirtual ◆ call_time double SThreadPool_PID_ErrInfo::call_time ◆ err double SThreadPool_PID_ErrInfo::err ◆ m_CancelRequested atomic<bool> CThreadPool_Task::m_CancelRequested private ◆ m_Counted bool CThreadInPool_ForServer::m_Counted private ◆ m_Countertemplate<typename TRequest >
◆ m_Deltatemplate<typename TRequest >
◆ m_DerivCoeff double CThreadPool_Controller_PID::m_DerivCoeff private ◆ m_DerivTime double CThreadPool_Controller_PID::m_DerivTime private ◆ m_ErrHistory ◆ m_GetCond ◆ m_GetSemtemplate<typename TRequest >
◆ m_HungerCnttemplate<typename TRequest >
◆ m_HungerSemtemplate<typename TRequest >
◆ m_Impl [1/2]Actual implementation of the pool.
Definition at line 420 of file thread_pool.hpp.
Referenced by CThreadPool::Abort(), CThreadPool::AddTask(), CThreadPool::CancelTask(), CThreadPool::CancelTasks(), CThreadPool::CThreadPool(), CThreadPool::FlushThreads(), CThreadPool::GetDestroyTimeout(), CThreadPool::GetExecutingTasksCount(), CThreadPool::GetMainPoolMutex(), CThreadPool::GetQueuedTasksCount(), CThreadPool::GetThreadsCount(), CThreadPool::IsAborted(), CThreadPool::RequestExclusiveExecution(), CThreadPool_Impl::s_GetImplPointer(), CThreadPool::SetDestroyTimeout(), and CThreadPool::~CThreadPool().
◆ m_Impl [2/2] ◆ m_InHandleEvent bool CThreadPool_Controller::m_InHandleEvent private ◆ m_IntegrCoeff double CThreadPool_Controller_PID::m_IntegrCoeff private ◆ m_IntegrErr double CThreadPool_Controller_PID::m_IntegrErr private ◆ m_IsBusy ◆ m_KilledAll bool CPoolOfThreads_ForServer::m_KilledAll private ◆ m_MaxSizetemplate<typename TRequest >
◆ m_MaxThreads [1/3] volatile TACValue CPoolOfThreads_ForServer::m_MaxThreads private ◆ m_MaxThreads [2/3] unsigned int CThreadPool_Controller::m_MaxThreads private ◆ m_MaxThreads [3/3]template<typename TRequest >
◆ m_MaxUrgentThreadstemplate<typename TRequest >
The maximum number of urgent threads running simultaneously.
Definition at line 504 of file thread_pool_old.hpp.
◆ m_MinThreads unsigned int CThreadPool_Controller::m_MinThreads private ◆ m_Mutex [1/4] CMutex CBlockingQueue_ForServer::m_Mutex mutableprotected ◆ m_Mutex [2/4] CMutex CPoolOfThreads_ForServer::m_Mutex private ◆ m_Mutex [3/4]template<typename TRequest >
◆ m_Mutex [4/4]template<typename TRequest >
◆ m_Pool [1/4] TPool* CThreadInPool_ForServer::m_Pool private ◆ m_Pool [2/4] ◆ m_Pool [3/4] ◆ m_Pool [4/4]template<typename TRequest >
◆ m_Priority [1/2] unsigned int CThreadPool_Task::m_Priority private ◆ m_Priority [2/2] ◆ m_PutSemtemplate<typename TRequest >
◆ m_Queue [1/4] ◆ m_Queue [2/4] TQueue CPoolOfThreads_ForServer::m_Queue private ◆ m_Queue [3/4]template<typename TRequest >
◆ m_Queue [4/4]template<typename TRequest >
◆ m_QueuingForbidden ◆ m_Request [1/2] TRequest CBlockingQueue_ForServer::CQueueItem::m_Request private ◆ m_Request [2/2]template<typename TRequest >
◆ m_RequestCounter ◆ m_RunModetemplate<typename TRequest >
◆ m_Status [1/3] EStatus CQueueItemBase_ForServer::m_Status protected ◆ m_Status [2/3] atomic<EStatus> CThreadPool_Task::m_Status private ◆ m_Status [3/3] ◆ m_Thread [1/2] ◆ m_Thread [2/2] ◆ m_ThreadCount [1/2] ◆ m_ThreadCount [2/2]template<typename TRequest >
◆ m_ThreadNametemplate<typename TRequest >
◆ m_Threads [1/2] TThreads CPoolOfThreads_ForServer::m_Threads private ◆ m_Threads [2/2] ◆ m_Threshold [1/2] double CThreadPool_Controller_PID::m_Threshold private ◆ m_Threshold [2/2]template<typename TRequest >
◆ m_ThrSuffix string CPoolOfThreads_ForServer::m_ThrSuffix private ◆ m_Timer ◆ m_UrgentThreadCounttemplate<typename TRequest >
◆ CAutoUnregGuard [1/2] ◆ CAutoUnregGuard [2/2] ◆ CBlockingQueue< TRequest > ◆ CBlockingQueue_ForServer ◆ CThreadInPool< TRequest > ◆ CThreadInPool_ForServer ◆ CThreadPool_Impl [1/3] ◆ CThreadPool_Impl [2/3] ◆ CThreadPool_Impl [3/3] ◆ CThreadPool_ThreadImplRetroSearch 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