|
CatapultServer
v0.5.0.1 (Elephant)
|
Classes | |
| class | ServiceGroup |
Public Types | |
| enum | IsolatedPoolMode { IsolatedPoolMode::Enabled, IsolatedPoolMode::Disabled } |
| Isolated pool mode. More... | |
Public Member Functions | |
| MultiServicePool (const std::string &name, size_t numWorkerThreads, IsolatedPoolMode isolatedPoolMode=IsolatedPoolMode::Enabled) | |
| ~MultiServicePool () | |
| Destroys the pool. More... | |
| size_t | numWorkerThreads () const |
| Gets the number of active worker threads. More... | |
| size_t | numServiceGroups () const |
| Gets the number of service groups. More... | |
| size_t | numServices () const |
| std::shared_ptr< ServiceGroup > | pushServiceGroup (const std::string &name) |
| Creates a new service group with name. More... | |
| std::shared_ptr< thread::IoThreadPool > | pushIsolatedPool (const std::string &name) |
| Creates a new isolated thread pool with a default number of threads and name. More... | |
| std::shared_ptr< thread::IoThreadPool > | pushIsolatedPool (const std::string &name, size_t numWorkerThreads) |
| void | shutdown () |
| Safely shuts down the thread pool and its dependent services. More... | |
Static Public Member Functions | |
| static constexpr size_t | DefaultPoolConcurrency () |
| A default pool concurrency level based on the local hardware configuration. More... | |
Private Member Functions | |
| template<typename TService > | |
| auto | registerService (const std::shared_ptr< TService > &pService, const std::string &serviceName) |
Static Private Member Functions | |
| static std::shared_ptr< thread::IoThreadPool > | CreateThreadPool (size_t numWorkerThreads, const std::string &name) |
| template<typename T > | |
| static void | WaitForLastReference (const std::shared_ptr< T > &pVoid) |
Private Attributes | |
| std::string | m_name |
| IsolatedPoolMode | m_isolatedPoolMode |
| size_t | m_numTotalIsolatedPoolThreads |
| size_t | m_numServiceGroups |
| std::shared_ptr< thread::IoThreadPool > | m_pPool |
| std::vector< std::shared_ptr< ServiceGroup > > | m_serviceGroups |
| std::vector< action > | m_shutdownFunctions |
Manages a primary thread pool with dependent service groups and secondary isolated thread pools.
|
inline |
Creates a pool with the specified number of threads (numWorkerThreads) and name with optional isolated pool mode (isolatedPoolMode).
0, a default number of threads will be used.
|
inline |
Destroys the pool.

|
inlinestaticprivate |


|
inlinestaticconstexpr |
A default pool concurrency level based on the local hardware configuration.

|
inline |
Gets the number of service groups.

|
inline |
Gets the number of services.

|
inline |
Gets the number of active worker threads.

|
inline |
Creates a new isolated thread pool with a default number of threads and name.

|
inline |
Creates a new isolated thread pool with the specified number of threads (numWorkerThreads) and name.
0, a default number of threads will be used. 
|
inline |
Creates a new service group with name.

|
inlineprivate |


|
inline |
Safely shuts down the thread pool and its dependent services.


|
inlinestaticprivate |

|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |