Fennel: ThreadPoolBase Class Reference (original) (raw)
ThreadPoolBase defines the non-templated portion of ThreadPool. More...
#include <[ThreadPool.h](ThreadPool%5F8h-source.html)>
Inheritance diagram for ThreadPoolBase:

| Public Member Functions | |
|---|---|
| void | start (uint nThreads) |
| Starts the given number of threads in the pool. | |
| void | stop () |
| Shuts down the pool, waiting for any pending tasks to complete. | |
| void | setThreadTracker (ThreadTracker &threadTracker) |
| Sets a tracker to use for created threads. | |
| Protected Types | |
| enum | State { STATE_STARTED, STATE_STOPPING, STATE_STOPPED } |
| Protected Member Functions | |
| ThreadPoolBase () | |
| virtual | ~ThreadPoolBase () |
| virtual bool | isQueueEmpty ()=0 |
| virtual void | runOneTask (StrictMutexGuard &)=0 |
| Protected Attributes | |
| std::vector< PooledThread * > | threads |
| State | state |
| LocalCondition | stoppingCondition |
| ThreadTracker * | pThreadTracker |
| StrictMutex | mutex |
| LocalCondition | condition |
| Private Member Functions | |
| void | runPooledThread () |
| Friends | |
| class | PooledThread |
Detailed Description
ThreadPoolBase defines the non-templated portion of ThreadPool.
Definition at line 40 of file ThreadPool.h.
Member Enumeration Documentation
Enumerator:
| STATE_STARTED | | | ----------------- | | | STATE_STOPPING | | | STATE_STOPPED | |
Definition at line 46 of file ThreadPool.h.
Constructor & Destructor Documentation
| ThreadPoolBase::ThreadPoolBase | ( | | ) | [explicit, protected] | | ------------------------------ | - | | - | ----------------------- |
| ThreadPoolBase::~ThreadPoolBase | ( | | ) | [protected, virtual] | | -------------------------------- | - | | - | ---------------------- |
Member Function Documentation
| void ThreadPoolBase::runPooledThread | ( | | ) | [private] | | ------------------------------------ | - | | - | ----------- |
| virtual bool ThreadPoolBase::isQueueEmpty | ( | | ) | [protected, pure virtual] | | ----------------------------------------- | - | | - | --------------------------- |
| virtual void ThreadPoolBase::runOneTask | ( | StrictMutexGuard & | | ) | [protected, pure virtual] | | --------------------------------------- | - | ------------------------------------------------------------------------- | | - | --------------------------- |
| void ThreadPoolBase::start | ( | uint | nThreads | ) |
|---|
| void ThreadPoolBase::stop | ( | | ) | | ------------------------- | - | | - |
Shuts down the pool, waiting for any pending tasks to complete.
The start/stop calls should never be invoked from more than one thread simultaneously.
Definition at line 73 of file ThreadPool.cpp.
References SynchMonitoredObject::condition, deleteAndNullify(), isQueueEmpty(), SynchMonitoredObject::mutex, state, STATE_STOPPED, STATE_STOPPING, stoppingCondition, and threads.
Referenced by ExternalSortExecStreamImpl::computeFirstResultParallel(), ThreadedTestBase::runThreadedTestCase(), ParallelExecStreamScheduler::stop(), and ThreadPoolScheduler::stop().
| void ThreadPoolBase::setThreadTracker | ( | ThreadTracker & | threadTracker | ) |
|---|
Friends And Related Function Documentation
Member Data Documentation
Definition at line 38 of file SynchMonitoredObject.h.
Referenced by ParallelExecStreamScheduler::abort(), LogicalTxnLog::checkpoint(), Database::checkpointImpl(), CheckpointThread::closeImpl(), LogicalTxnLog::commitTxn(), ParallelExecStreamScheduler::executeManager(), ParallelExecStreamScheduler::executeTask(), LogicalTxnLog::getOldestActiveTxnId(), LogicalTxnLog::newLogicalTxn(), ParallelExecStreamScheduler::readStream(), SXMutex::release(), GroupLock::release(), Database::requestCheckpoint(), CheckpointThread::requestCheckpoint(), LogicalTxnLog::rollbackTxn(), TimerThread::run(), CheckpointThread::run(), runPooledThread(), SXMutex::setSchedulingPolicy(), TimerThread::signalImmediate(), ParallelExecStreamScheduler::signalSentinel(), start(), TimerThread::stop(), stop(), ParallelExecStreamScheduler::stop(), ThreadPool< RandomAccessRequest >::submitTask(), ParallelExecStreamScheduler::tryExecuteManager(), ParallelExecStreamScheduler::tryExecuteTask(), SXMutex::tryUpgrade(), SXMutex::waitFor(), GroupLock::waitFor(), and Database::writeStats().
Definition at line 39 of file SynchMonitoredObject.h.
Referenced by ParallelExecStreamScheduler::abort(), Database::checkpointImpl(), CheckpointThread::closeImpl(), LogicalTxnLog::commitTxnWithGroup(), ParallelExecStreamScheduler::executeTask(), ParallelExecStreamScheduler::readStream(), SXMutex::release(), GroupLock::release(), Database::requestCheckpoint(), CheckpointThread::requestCheckpoint(), TimerThread::run(), CheckpointThread::run(), runPooledThread(), TimerThread::signalImmediate(), TimerThread::stop(), stop(), ParallelExecStreamScheduler::stop(), ThreadPool< RandomAccessRequest >::submitTask(), ParallelExecStreamScheduler::tryExecuteManager(), ParallelExecStreamScheduler::tryExecuteTask(), SXMutex::waitFor(), and GroupLock::waitFor().
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/synch/ThreadPool.h
- /home/pub/open/dev/fennel/synch/ThreadPool.cpp
