Remote Call Framework 3.4
RCF::ThreadPool Class Reference

Represents a server-side thread pool. More...

#include <ThreadPool.hpp>

Inherits enable_shared_from_this< ThreadPool >.

Public Member Functions

void setThreadMinCount (std::size_t threadMinCount)
 Sets the minimum number of threads in the thread pool. More...
 
std::size_t getThreadMinCount () const
 Returns the minimum number of threads in the thread pool. More...
 
void setThreadMaxCount (std::size_t threadMaxCount)
 Sets the maximum number of threads in the thread pool. More...
 
std::size_t getThreadMaxCount () const
 Returns the maximum number of threads in the thread pool. More...
 
void setThreadIdleTimeoutMs (std::uint32_t threadIdleTimeoutMs)
 
std::uint32_t getThreadIdleTimeoutMs () const
 Returns the thread idle timeout value, in milliseconds. More...
 
void setReserveLastThread (bool reserveLastThread)
 
void setThreadName (const std::string &threadName)
 Sets the thread name of the thread pool threads, as visible in a debugger. More...
 
std::string getThreadName () const
 Returns the thread name of the thread pool threads. More...
 
void addThreadInitFunctor (ThreadInitFunctor threadInitFunctor)
 Sets a function which will be called once by each thread when it starts. More...
 
void addThreadDeinitFunctor (ThreadDeinitFunctor threadDeinitFunctor)
 Sets a function which will be called once by each thread when it is about to stop. More...
 

Detailed Description

Represents a server-side thread pool.

Member Function Documentation

◆ setThreadMinCount()

void RCF::ThreadPool::setThreadMinCount ( std::size_t  threadMinCount)

Sets the minimum number of threads in the thread pool.

◆ getThreadMinCount()

std::size_t RCF::ThreadPool::getThreadMinCount ( ) const

Returns the minimum number of threads in the thread pool.

◆ setThreadMaxCount()

void RCF::ThreadPool::setThreadMaxCount ( std::size_t  threadMaxCount)

Sets the maximum number of threads in the thread pool.

◆ getThreadMaxCount()

std::size_t RCF::ThreadPool::getThreadMaxCount ( ) const

Returns the maximum number of threads in the thread pool.

◆ setThreadIdleTimeoutMs()

void RCF::ThreadPool::setThreadIdleTimeoutMs ( std::uint32_t  threadIdleTimeoutMs)

Sets the thread idle timeout value, in milliseconds. After a thread has been idle for this time, it will be shut down, unless the thread count is already at the minimum value for the thread pool.

◆ getThreadIdleTimeoutMs()

std::uint32_t RCF::ThreadPool::getThreadIdleTimeoutMs ( ) const

Returns the thread idle timeout value, in milliseconds.

◆ setReserveLastThread()

void RCF::ThreadPool::setReserveLastThread ( bool  reserveLastThread)

If this setting is true, clients will receive an error message right away, if all threads in the thread pool are busy. Otherwise, the client will wait for a thread in the thread pool to become free.

◆ setThreadName()

void RCF::ThreadPool::setThreadName ( const std::string &  threadName)

Sets the thread name of the thread pool threads, as visible in a debugger.

◆ getThreadName()

std::string RCF::ThreadPool::getThreadName ( ) const

Returns the thread name of the thread pool threads.

◆ addThreadInitFunctor()

void RCF::ThreadPool::addThreadInitFunctor ( ThreadInitFunctor  threadInitFunctor)

Sets a function which will be called once by each thread when it starts.

◆ addThreadDeinitFunctor()

void RCF::ThreadPool::addThreadDeinitFunctor ( ThreadDeinitFunctor  threadDeinitFunctor)

Sets a function which will be called once by each thread when it is about to stop.


The documentation for this class was generated from the following file: