NCBI C++ ToolKit
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
CPoolOfThreads_ForServer Class Reference

Search Toolkit Book for CPoolOfThreads_ForServer

#include <connect/impl/thread_pool_for_server.hpp>

+ Collaboration diagram for CPoolOfThreads_ForServer:

Public Types

typedef CThreadInPool_ForServer TThread
typedef CBlockingQueue_ForServer TQueue
typedef TQueue::TItemHandle TItemHandle
typedef TQueue::TRequest TRequest

Public Member Functions

 CPoolOfThreads_ForServer (unsigned int max_threads, const string &thr_suffix)
 Constructor. More...
virtual ~CPoolOfThreads_ForServer (void)
 Destructor. More...
void Spawn (unsigned int num_threads)
 Start processing threads. More...
void AcceptRequest (const TRequest &request)
 Put a request in the queue with a given priority. More...
TItemHandle GetHandle (void)
void KillAllThreads (bool wait)
 Causes all threads in the pool to exit cleanly after finishing all pending requests, optionally waiting for them to die. More...

Private Types

typedef CAtomicCounter::TValue TACValue
typedef list< CRef< TThread > > TThreads

Private Member Functions

TThreadNewThread (void)
 Create a new thread. More...
bool Register (TThread &thread)
 Register a thread. More...
void UnRegister (TThread &)
 Unregister a thread. More...

Private Attributes

volatile TACValue m_MaxThreads
 The maximum number of threads the pool can hold. More...
CAtomicCounter m_ThreadCount
 The current number of threads in the pool. More...
CMutex m_Mutex
 The guard for m_MaxThreads and m_MaxUrgentThreads. More...
TQueue m_Queue
string m_ThrSuffix
TThreads m_Threads
bool m_KilledAll


class CThreadInPool_ForServer

Detailed Description

Definition at line 212 of file thread_pool_for_server.hpp.

The documentation for this class was generated from the following files:
Modified on Sun Apr 14 05:28:49 2024 by rev. 669887