Threaded Pools for Request Handling
[UTIL]

Collaboration diagram for Threaded Pools for Request Handling:


Classes

class  CThreadPool_Task
 Abstract class for representing single task executing in pool of threads To use this class in application you should inherit your own class from it and define method Execute() - the main method where all task logic executes. More...
class  CThreadPool
 Main class implementing functionality of pool of threads. More...
class  CThreadPool_Thread
 Base class for a thread running inside CThreadPool and executing tasks. More...
class  CThreadPool_Controller
 Abstract class for controlling the number of threads in pool. More...
class  CThreadPoolException
 Exception class for all ThreadPool-related classes. More...
struct  SThreadPool_PID_ErrInfo
 Entry in "error" changing history Information about "error" in some point of time in the past kept in CThreadPool_Control_PID. More...
class  CThreadPool_Controller_PID
 Default ThreadPool controller based on Proportional-Integral-Derivative algorithm. More...
class  CQueueItemBase
 CQueueItemBase -- skeleton blocking-queue item, sans actual request. More...
class  CBlockingQueue< TRequest >
 CBlockingQueue<> -- queue of requests, with efficiently blocking Get(). More...
class  CThreadInPool< TRequest >
class  CPoolOfThreads< TRequest >
 CPoolOfThreads<> -- abstract pool of threads sharing a request queue. More...
class  CStdRequest
class  CStdThreadInPool
class  CStdPoolOfThreads

Functions

bool CThreadPool_Task::IsCancelRequested (void) const
 Check if cancelation of the task was requested.
EStatus CThreadPool_Task::GetStatus (void) const
 Get status of the task.
bool CThreadPool_Task::IsFinished (void) const
 Check if task execution has been already finished (successfully or not).
unsigned int CThreadPool_Task::GetPriority (void) const
 Get priority of the task.
unsigned int CThreadPool_Controller::GetMinThreads (void) const
 Get the minimum number of threads in pool.
unsigned int CThreadPool_Controller::GetMaxThreads (void) const
 Get the maximum number of threads in pool.
void CThreadPool_Controller_PID::SetQueuedTasksThreshold (double threshold)
 Set maximum number of tasks in queue per each thread The meaning of parameter is only approximate.
double CThreadPool_Controller_PID::GetQueuedTasksThreshold (void)
 Get maximum number of tasks in queue per each thread.
void CThreadPool_Controller_PID::SetTaskMaxQueuedTime (double queued_time)
 Set maximum time (in seconds) that task can wait in queue for processing until new thread will be launched.
double CThreadPool_Controller_PID::GetTaskMaxQueuedTime (void)
 Get maximum time that task can wait in queue for processing until new thread will be launched.
void CThreadPool_Controller_PID::SetChangeCalcTime (double calc_time)
 Set the time period (in seconds) for which average speed of changing of waiting tasks number is calculated.
double CThreadPool_Controller_PID::GetChangeCalcTime (void)
 Get the time period for which average speed of changing of waiting tasks number is calculated.
void CThreadPool_Controller_PID::SetChangePredictTime (double predict_time)
 Set period of prediction of number of tasks in queue The meaning of parameter is only approximate.
double CThreadPool_Controller_PID::GetChangePredictTime (void)
 Get period of prediction of number of tasks in queue.
void CBlockingQueue::CQueueItem::x_SetStatus (EStatus new_status)
TItemHandle CBlockingQueue::Put (const TRequest &request, TUserPriority priority=0, unsigned int timeout_sec=0, unsigned int timeout_nsec=0)
 Put a request into the queue.
void CBlockingQueue::WaitForRoom (unsigned int timeout_sec=kMax_UInt, unsigned int timeout_nsec=0) const
 Wait for room in the queue for up to timeout_sec + timeout_nsec/1E9 seconds.
void CBlockingQueue::WaitForHunger (unsigned int timeout_sec=kMax_UInt, unsigned int timeout_nsec=0) const
 Wait for the queue to have waiting readers, for up to timeout_sec + timeout_nsec/1E9 seconds.
TItemHandle CBlockingQueue::GetHandle (unsigned int timeout_sec=kMax_UInt, unsigned int timeout_nsec=0)
 Get the first available request from the queue, and return a handle to it.
NCBI_DEPRECATED TRequest CBlockingQueue::Get (unsigned int timeout_sec=kMax_UInt, unsigned int timeout_nsec=0)
 Get the first available request from the queue, and return just the request.
size_t CBlockingQueue::GetSize (void) const
 Get the number of requests in the queue.
void CBlockingQueue::SetUserPriority (TItemHandle handle, TUserPriority priority)
 Adjust a pending request's priority.
void CBlockingQueue::Withdraw (TItemHandle handle)
 Withdraw a pending request from consideration.
bool CBlockingQueue::x_WaitForPredicate (TQueuePredicate pred, CSemaphore &sem, CMutexGuard &guard, unsigned int timeout_sec, unsigned int timeout_nsec) const
virtual void * CThreadInPool::Main (void)
 Derived (user-created) class must provide a real thread function.
virtual void CThreadInPool::OnExit (void)
 Override this to execute finalization code.
virtual void CThreadInPool::ProcessRequest (TItemHandle handle)
 Process a request.
 CPoolOfThreads::CPoolOfThreads (unsigned int max_threads, unsigned int queue_size, unsigned int spawn_threshold=1, unsigned int max_urgent_threads=kMax_UInt)
 Constructor.
virtual CPoolOfThreads::~CPoolOfThreads (void)
 Destructor.
void CPoolOfThreads::Spawn (unsigned int num_threads)
 Start processing threads.
TItemHandle CPoolOfThreads::AcceptRequest (const TRequest &request, TUserPriority priority=0, unsigned int timeout_sec=0, unsigned int timeout_nsec=0)
 Put a request in the queue with a given priority.
TItemHandle CPoolOfThreads::AcceptUrgentRequest (const TRequest &request, unsigned int timeout_sec=0, unsigned int timeout_nsec=0)
 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.
bool CPoolOfThreads::HasImmediateRoom (bool urgent=false) const
 Check whether a new request could be immediately processed.
void CPoolOfThreads::WaitForRoom (unsigned int timeout_sec=kMax_UInt, unsigned int timeout_nsec=0)
 Wait for the room in the queue up to timeout_sec + timeout_nsec/1E9 seconds.
TItemHandle CPoolOfThreads::x_AcceptRequest (const TRequest &req, TUserPriority priority, bool urgent, unsigned int timeout_sec=0, unsigned int timeout_nsec=0)
void CPoolOfThreads::SetUserPriority (TItemHandle handle, TUserPriority priority)
 Adjust a pending request's priority.


Function Documentation

template<typename TRequest>
CPoolOfThreads< TRequest >::TItemHandle CPoolOfThreads< TRequest >::AcceptRequest const TRequest &  request,
TUserPriority  priority = 0,
unsigned int  timeout_sec = 0,
unsigned int  timeout_nsec = 0
[inline, inherited]
 

Put a request in the queue with a given priority.

Parameters:
request A request
priority The priority of the request. The higher the priority the sooner the request will be processed.

Definition at line 997 of file thread_pool_old.hpp.

References CPoolOfThreads< TRequest >::x_AcceptRequest().

Referenced by CThreadedServer::Run().

template<typename TRequest>
CPoolOfThreads< TRequest >::TItemHandle CPoolOfThreads< TRequest >::AcceptUrgentRequest const TRequest &  request,
unsigned int  timeout_sec = 0,
unsigned int  timeout_nsec = 0
[inline, inherited]
 

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.

Parameters:
request A request

Definition at line 1008 of file thread_pool_old.hpp.

References CPoolOfThreads< TRequest >::x_AcceptRequest().

template<typename TRequest>
CPoolOfThreads< TRequest >::CPoolOfThreads unsigned int  max_threads,
unsigned int  queue_size,
unsigned int  spawn_threshold = 1,
unsigned int  max_urgent_threads = kMax_UInt
[inherited]
 

Constructor.

Parameters:
max_threads The maximum number of threads that this pool can run
queue_size The maximum number of requests in the queue
spawn_threashold The number of requests in the queue after which a new thread is started
max_urgent_threads The maximum number of urgent threads running simultaneously

Definition at line 956 of file thread_pool_old.hpp.

References _ASSERT, CPoolOfThreads< TRequest >::kDeltaOffset, CPoolOfThreads< TRequest >::m_Delta, CPoolOfThreads< TRequest >::m_ThreadCount, CPoolOfThreads< TRequest >::m_UrgentThreadCount, and CAtomicCounter::Set().

template<typename TRequest>
TRequest CBlockingQueue< TRequest >::Get unsigned int  timeout_sec = kMax_UInt,
unsigned int  timeout_nsec = 0
[inherited]
 

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.

Parameters:
timeout_sec Number of seconds
timeout_nsec Number of nanoseconds

Definition at line 772 of file thread_pool_old.hpp.

References CBlockingQueue< TRequest >::GetHandle().

double CThreadPool_Controller_PID::GetChangeCalcTime void   )  [inline, inherited]
 

Get the time period for which average speed of changing of waiting tasks number is calculated.

Definition at line 217 of file thread_pool_ctrl.hpp.

References CThreadPool_Controller_PID::m_DerivTime.

double CThreadPool_Controller_PID::GetChangePredictTime void   )  [inline, inherited]
 

Get period of prediction of number of tasks in queue.

See also:
SetChangePredictTime()

Definition at line 229 of file thread_pool_ctrl.hpp.

References CThreadPool_Controller_PID::m_DerivCoeff.

template<typename TRequest>
CBlockingQueue< TRequest >::TItemHandle CBlockingQueue< TRequest >::GetHandle unsigned int  timeout_sec = kMax_UInt,
unsigned int  timeout_nsec = 0
[inherited]
 

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.

Parameters:
timeout_sec Number of seconds
timeout_nsec Number of nanoseconds

Definition at line 728 of file thread_pool_old.hpp.

References _VERIFY, set< Key, Compare >::empty(), CBlockingQueue< TRequest >::m_GetSem, CBlockingQueue< TRequest >::m_HungerCnt, CBlockingQueue< TRequest >::m_HungerSem, CBlockingQueue< TRequest >::m_Mutex, CBlockingQueue< TRequest >::m_Queue, CSemaphore::Post(), set< Key, Compare >::size(), CSemaphore::TryWait(), CBlockingQueue< TRequest >::x_GetSemPred(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

Referenced by CBlockingQueue< TRequest >::Get(), and CPrefetchThreadOld::Main().

unsigned int CThreadPool_Controller::GetMaxThreads void   )  const [inline, inherited]
 

Get the maximum number of threads in pool.

Definition at line 642 of file thread_pool.hpp.

References CThreadPool_Controller::m_MaxThreads.

Referenced by CThreadPool_Controller::SetThreadsCount().

unsigned int CThreadPool_Controller::GetMinThreads void   )  const [inline, inherited]
 

Get the minimum number of threads in pool.

Definition at line 636 of file thread_pool.hpp.

References CThreadPool_Controller::m_MinThreads.

Referenced by CThreadPool_Controller_PID::OnEvent(), and CThreadPool_Controller::SetThreadsCount().

unsigned int CThreadPool_Task::GetPriority void   )  const [inline, inherited]
 

Get priority of the task.

Definition at line 629 of file thread_pool.hpp.

References CThreadPool_Task::m_Priority.

double CThreadPool_Controller_PID::GetQueuedTasksThreshold void   )  [inline, inherited]
 

Get maximum number of tasks in queue per each thread.

See also:
SetQueuedTasksThreshold()

Definition at line 193 of file thread_pool_ctrl.hpp.

References CThreadPool_Controller_PID::m_Threshold.

template<typename TRequest>
size_t CBlockingQueue< TRequest >::GetSize void   )  const [inherited]
 

Get the number of requests in the queue.

Definition at line 782 of file thread_pool_old.hpp.

References CBlockingQueue< TRequest >::m_Mutex, CBlockingQueue< TRequest >::m_Queue, and size.

Referenced by CPoolOfThreads< CRef< CStdRequest > >::GetQueueSize().

CThreadPool_Task::EStatus CThreadPool_Task::GetStatus void   )  const [inline, inherited]
 

Get status of the task.

Definition at line 617 of file thread_pool.hpp.

References CThreadPool_Task::m_Status.

Referenced by CPrefetchRequest::GetState(), CPrefetchRequest::SetProgress(), and CThreadPool_Task::x_RequestToCancel().

double CThreadPool_Controller_PID::GetTaskMaxQueuedTime void   )  [inline, inherited]
 

Get maximum time that task can wait in queue for processing until new thread will be launched.

See also:
SetTaskMaxQueuedTime()

Definition at line 205 of file thread_pool_ctrl.hpp.

References CThreadPool_Controller_PID::m_IntegrCoeff.

template<typename TRequest>
bool CPoolOfThreads< TRequest >::HasImmediateRoom bool  urgent = false  )  const [inline, inherited]
 

Check whether a new request could be immediately processed.

Parameters:
urgent Whether the request would be urgent.

Definition at line 1017 of file thread_pool_old.hpp.

References CBlockingQueue< TRequest >::IsFull(), and CPoolOfThreads< TRequest >::m_Queue.

Referenced by CPoolOfThreads< TRequest >::WaitForRoom(), and CPoolOfThreads< TRequest >::x_AcceptRequest().

bool CThreadPool_Task::IsCancelRequested void   )  const [inline, inherited]
 

Check if cancelation of the task was requested.

Definition at line 611 of file thread_pool.hpp.

References CThreadPool_Task::m_CancelRequested.

Referenced by CPrefetchManager::IsActive().

bool CThreadPool_Task::IsFinished void   )  const [inline, inherited]
 

Check if task execution has been already finished (successfully or not).

Definition at line 623 of file thread_pool.hpp.

References CThreadPool_Task::eCompleted, and CThreadPool_Task::m_Status.

Referenced by CThreadPool_Impl::CancelTask(), CPrefetchRequest::IsDone(), CThreadPool_Task::RequestToCancel(), and CThreadPool_Task::x_SetStatus().

template<typename TRequest>
void * CThreadInPool< TRequest >::Main void   )  [private, virtual, inherited]
 

Derived (user-created) class must provide a real thread function.

Implements CThread.

Definition at line 883 of file thread_pool_old.hpp.

References CAtomicCounter::Add(), ERR_POST_XX, CThreadInPool< TRequest >::eRunOnce, CThreadInPool< TRequest >::Init(), CPoolOfThreads< TRequest >::m_Delta, CThreadInPool< TRequest >::m_Pool, CPoolOfThreads< TRequest >::m_Queue, CThreadInPool< TRequest >::m_RunMode, CThreadInPool< TRequest >::ProcessRequest(), CPoolOfThreads< TRequest >::Register(), CPoolOfThreads< TRequest >::UnRegister(), and CException::what().

template<typename TRequest>
void CThreadInPool< TRequest >::OnExit void   )  [private, virtual, inherited]
 

Override this to execute finalization code.

Unlike destructor, this code will be executed before thread termination and as a part of the thread.

Reimplemented from CThread.

Definition at line 932 of file thread_pool_old.hpp.

References CAtomicCounter::Add(), CThreadInPool< TRequest >::eRunOnce, CThreadInPool< TRequest >::m_Pool, CThreadInPool< TRequest >::m_RunMode, CPoolOfThreads< TRequest >::m_ThreadCount, CPoolOfThreads< TRequest >::m_UrgentThreadCount, STD_CATCH_ALL_XX, and CThreadInPool< TRequest >::x_OnExit().

template<typename TRequest>
void CThreadInPool< TRequest >::ProcessRequest TItemHandle  handle  )  [protected, virtual, inherited]
 

Process a request.

It is called from Main() for each request this thread handles

Parameters:
A request for processing

Definition at line 944 of file thread_pool_old.hpp.

Referenced by CThreadInPool< TRequest >::Main().

template<typename TRequest>
CBlockingQueue< TRequest >::TItemHandle CBlockingQueue< TRequest >::Put const TRequest &  request,
TUserPriority  priority = 0,
unsigned int  timeout_sec = 0,
unsigned int  timeout_nsec = 0
[inherited]
 

Put a request into the queue.

If the queue remains full for the duration of the (optional) timeout, throw an exception.

Parameters:
request Request
priority The priority of the request. The higher the priority the sooner the request will be processed.
timeout_sec Number of whole seconds in timeout
timeout_nsec Number of additional nanoseconds in timeout

Definition at line 657 of file thread_pool_old.hpp.

References set< Key, Compare >::empty(), CBlockingQueue< TRequest >::m_GetSem, CBlockingQueue< TRequest >::m_Mutex, CBlockingQueue< TRequest >::m_PutSem, CBlockingQueue< TRequest >::m_Queue, NCBI_THROW, CSemaphore::Post(), CSemaphore::TryWait(), CBlockingQueue< TRequest >::x_PutSemPred(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

Referenced by CPrefetchThreadOld::AddRequest(), CPrefetchThreadOld::Terminate(), and CPoolOfThreads< TRequest >::x_AcceptRequest().

void CThreadPool_Controller_PID::SetChangeCalcTime double  calc_time  )  [inline, inherited]
 

Set 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.

void CThreadPool_Controller_PID::SetChangePredictTime double  predict_time  )  [inline, inherited]
 

Set 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.

See also:
SetQueuedTasksThreshold()

Definition at line 223 of file thread_pool_ctrl.hpp.

References CThreadPool_Controller_PID::m_DerivCoeff.

void CThreadPool_Controller_PID::SetQueuedTasksThreshold double  threshold  )  [inline, inherited]
 

Set 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.

void CThreadPool_Controller_PID::SetTaskMaxQueuedTime double  queued_time  )  [inline, inherited]
 

Set 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.

See also:
SetQueuedTasksThreshold()

Definition at line 199 of file thread_pool_ctrl.hpp.

References CThreadPool_Controller_PID::m_IntegrCoeff.

template<typename TRequest>
void CPoolOfThreads< TRequest >::SetUserPriority TItemHandle  handle,
TUserPriority  priority
[inline, inherited]
 

Adjust a pending request's priority.

Definition at line 1103 of file thread_pool_old.hpp.

template<typename TRequest>
void CBlockingQueue< TRequest >::SetUserPriority TItemHandle  handle,
TUserPriority  priority
[inherited]
 

Adjust a pending request's priority.

Definition at line 790 of file thread_pool_old.hpp.

References CQueueItemBase::ePending.

template<typename TRequest>
void CPoolOfThreads< TRequest >::Spawn unsigned int  num_threads  )  [inherited]
 

Start processing threads.

Parameters:
num_threads The number of threads to start

Definition at line 984 of file thread_pool_old.hpp.

References CAtomicCounter::Add(), CThreadInPool< TRequest >::eNormal, CPoolOfThreads< TRequest >::m_ThreadCount, CPoolOfThreads< TRequest >::NewThread(), and CThread::Run().

Referenced by CThreadedServer::Run().

template<typename TRequest>
void CBlockingQueue< TRequest >::WaitForHunger unsigned int  timeout_sec = kMax_UInt,
unsigned int  timeout_nsec = 0
const [inherited]
 

Wait for the queue to have waiting readers, for up to timeout_sec + timeout_nsec/1E9 seconds.

Parameters:
timeout_sec Number of seconds
timeout_nsec Number of nanoseconds

Definition at line 712 of file thread_pool_old.hpp.

References CBlockingQueue< TRequest >::m_HungerSem, CBlockingQueue< TRequest >::m_Mutex, NCBI_THROW, CSemaphore::Post(), CBlockingQueue< TRequest >::x_HungerSemPred(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

Referenced by CPoolOfThreads< TRequest >::WaitForRoom().

template<typename TRequest>
void CPoolOfThreads< TRequest >::WaitForRoom unsigned int  timeout_sec = kMax_UInt,
unsigned int  timeout_nsec = 0
[inline, inherited]
 

Wait for the room in the queue up to timeout_sec + timeout_nsec/1E9 seconds.

Parameters:
timeout_sec Number of seconds
timeout_nsec Number of nanoseconds

Definition at line 1045 of file thread_pool_old.hpp.

References CPoolOfThreads< TRequest >::HasImmediateRoom(), CPoolOfThreads< TRequest >::m_Queue, CPoolOfThreads< TRequest >::m_QueuingForbidden, CBlockingQueue< TRequest >::WaitForHunger(), and CBlockingQueue< TRequest >::WaitForRoom().

Referenced by CThreadedServer::Run().

template<typename TRequest>
void CBlockingQueue< TRequest >::WaitForRoom unsigned int  timeout_sec = kMax_UInt,
unsigned int  timeout_nsec = 0
const [inherited]
 

Wait for room in the queue for up to timeout_sec + timeout_nsec/1E9 seconds.

Parameters:
timeout_sec Number of seconds
timeout_nsec Number of nanoseconds

Definition at line 697 of file thread_pool_old.hpp.

References CBlockingQueue< TRequest >::m_Mutex, CBlockingQueue< TRequest >::m_PutSem, NCBI_THROW, CSemaphore::Post(), CBlockingQueue< TRequest >::x_PutSemPred(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

Referenced by CPoolOfThreads< TRequest >::WaitForRoom().

template<typename TRequest>
void CBlockingQueue< TRequest >::Withdraw TItemHandle  handle  )  [inherited]
 

Withdraw a pending request from consideration.

Definition at line 813 of file thread_pool_old.hpp.

References CQueueItemBase::ePending.

Referenced by CPoolOfThreads< CRef< CStdRequest > >::Withdraw().

template<typename TRequest>
CPoolOfThreads< TRequest >::TItemHandle CPoolOfThreads< TRequest >::x_AcceptRequest const TRequest &  req,
TUserPriority  priority,
bool  urgent,
unsigned int  timeout_sec = 0,
unsigned int  timeout_nsec = 0
[inline, private, inherited]
 

Definition at line 1060 of file thread_pool_old.hpp.

References CAtomicCounter::Add(), CAtomicCounter::Get(), CPoolOfThreads< TRequest >::HasImmediateRoom(), CPoolOfThreads< TRequest >::m_Delta, CPoolOfThreads< TRequest >::m_MaxThreads, CPoolOfThreads< TRequest >::m_MaxUrgentThreads, CPoolOfThreads< TRequest >::m_Mutex, CPoolOfThreads< TRequest >::m_Queue, CPoolOfThreads< TRequest >::m_QueuingForbidden, CPoolOfThreads< TRequest >::m_ThreadCount, CPoolOfThreads< TRequest >::m_Threshold, CPoolOfThreads< TRequest >::m_UrgentThreadCount, NCBI_THROW, and CBlockingQueue< TRequest >::Put().

Referenced by CPoolOfThreads< TRequest >::AcceptRequest(), and CPoolOfThreads< TRequest >::AcceptUrgentRequest().

template<typename TRequest>
EMPTY_TEMPLATE void CBlockingQueue< TRequest >::CQueueItem::x_SetStatus EStatus  new_status  )  [inline, protected, inherited]
 

Definition at line 245 of file thread_pool_old.hpp.

References CQueueItemBase::x_SetStatus().

template<typename TRequest>
bool CBlockingQueue< TRequest >::x_WaitForPredicate TQueuePredicate  pred,
CSemaphore sem,
CMutexGuard guard,
unsigned int  timeout_sec,
unsigned int  timeout_nsec
const [private, inherited]
 

Definition at line 841 of file thread_pool_old.hpp.

References CurrentTime(), CTime::eCurrent, CTime::eGmt, ePositive, CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), CGuard< Resource, Lock, Unlock >::Guard(), kMax_Int, kNanoSecondsPerSecond, CBlockingQueue< TRequest >::m_Mutex, CBlockingQueue< TRequest >::m_Queue, CGuard< Resource, Lock, Unlock >::Release(), and CSemaphore::TryWait().

Referenced by CBlockingQueue< TRequest >::GetHandle(), CBlockingQueue< TRequest >::Put(), CBlockingQueue< TRequest >::WaitForHunger(), and CBlockingQueue< TRequest >::WaitForRoom().

template<typename TRequest>
CPoolOfThreads< TRequest >::~CPoolOfThreads void   )  [virtual, inherited]
 

Destructor.

Definition at line 973 of file thread_pool_old.hpp.

References ERR_POST_XX, CAtomicCounter::Get(), CPoolOfThreads< TRequest >::m_ThreadCount, and CPoolOfThreads< TRequest >::m_UrgentThreadCount.


Generated on Wed Dec 9 08:14:20 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:20:18 2009 by modify_doxy.py rev. 173732