*
Main(
void);
234 void Spawn(
unsigned intnum_threads);
It may be desirable to store handles obtained from GetHandle() in instances of CCompletingHandle to e...
CQueueItemBase â skeleton blocking-queue item, sans actual request.
TNCBIAtomicValue TValue
Alias TValue for TNCBIAtomicValue.
TObjectType * GetNCPointerOrNull(void) const THROWS_NONE
Get pointer value.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
TObjectType & GetObject(void)
Get object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void ProcessRequest(const TRequest &req)
Older interface (still delegated to by default)
bool Register(TThread &thread)
Register a thread.
CAutoUnregGuard(TThread *thr)
CMutex m_Mutex
The guard for m_MaxThreads and m_MaxUrgentThreads.
TItemHandle GetHandle(void)
CBlockingQueue_ForServer(void)
Constructor.
TPool * m_Pool
The pool that holds this thread.
TQueue::TRequest TRequest
TQueue::TItemHandle TItemHandle
CThreadInPool_ForServer(TPool *pool)
Constructor.
void UnRegister(TThread &)
Unregister a thread.
CAtomicCounter::TValue TACValue
friend class CThreadInPool_ForServer
CBlockingQueue_ForServer::CCompletingHandle TCompletingHandle
deque< TItemHandle > TRealQueue
The type of the queue.
void AcceptRequest(const TRequest &request)
Put a request in the queue with a given priority.
const EStatus & GetStatus(void) const
CThreadInPool_ForServer TThread
virtual void x_SetStatus(EStatus new_status)
void x_UnregisterThread(void)
CCompletingHandle(const TItemHandle &h)
CThreadInPool_ForServer TThread
CPoolOfThreads_ForServer(unsigned int max_threads, const string &thr_suffix)
Constructor.
CMutex m_Mutex
Guards access to queue.
list< CRef< TThread > > TThreads
TRealQueue m_Queue
The queue.
CBlockingQueue_ForServer & operator=(const CBlockingQueue_ForServer &)
CBlockingQueue_ForServer::TItemHandle TItemHandle
volatile TACValue m_MaxThreads
The maximum number of threads the pool can hold.
void MarkAsComplete(void)
CRef< CQueueItem > TItemHandle
virtual ~CPoolOfThreads_ForServer(void)
Destructor.
void x_SetStatus(EStatus new_status)
void KillAllThreads(bool wait)
Causes all threads in the pool to exit cleanly after finishing all pending requests,...
CBlockingQueue_ForServer::TRequest TRequest
TItemHandle Put(const TRequest &request)
Put a request into the queue.
TItemHandle GetHandle(void)
Get the first available request from the queue, and return a handle to it.
virtual void OnStatusChange(EStatus, EStatus)
Callback for status changes.
CBlockingQueue_ForServer(const CBlockingQueue_ForServer &)
forbidden
virtual ~CThreadInPool_ForServer(void)
Destructor.
TThread * NewThread(void)
Create a new thread.
CRef< CStdRequest > TRequest
CQueueItem(TRequest request)
const TRequest & GetRequest(void) const
CQueueItemBase_ForServer(void)
void MarkAsForciblyCaught(void)
CBlockingQueue_ForServer TQueue
CConditionVariable m_GetCond
virtual void * Main(void)
Derived (user-created) class must provide a real thread function.
void ProcessRequest(TItemHandle handle)
Process a request.
void x_HandleOneRequest(bool catch_all)
CAtomicCounter m_ThreadCount
The current number of threads in the pool.
virtual void Process(void)=0
Do the actual job Called by whichever thread handles this request.
CPoolOfThreads_ForServer TPool
void Spawn(unsigned int num_threads)
Start processing threads.
CQueueItemBase::EStatus EStatus
@ eComplete
extracted and released
@ eForciblyCaught
let an exception escape
CRef< CTestThread > thr[k_NumThreadsMax]
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