Distributed Cache
Public Member Functions | Private Attributes | List of all members
ServerThreadPool Class Reference

#include <server_thread_pool.h>

Collaboration diagram for ServerThreadPool:
Collaboration graph

Public Member Functions

 ServerThreadPool (MultiThreadedServerInterface *server, std::string ip, int port, int threadCount=30, int queueCapacity=20)
 
void start ()
 
void stop ()
 
void threadHandler ()
 

Private Attributes

std::queue< int > connectionQueue
 
std::mutex queueLock
 
std::condition_variable c_cons
 
std::condition_variable c_prod
 
int port
 
std::string ip
 
int threadCount
 
MultiThreadedServerInterface * server
 
std::vector< std::thread > threads
 
int socketConnection
 
int queueCapacity
 

Constructor & Destructor Documentation

◆ ServerThreadPool()

ServerThreadPool::ServerThreadPool ( MultiThreadedServerInterface *  server,
std::string  ip,
int  port,
int  threadCount = 30,
int  queueCapacity = 20 
)
inline

Member Function Documentation

◆ start()

void ServerThreadPool::start ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

void ServerThreadPool::stop ( )
inline
Here is the caller graph for this function:

◆ threadHandler()

void ServerThreadPool::threadHandler ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ c_cons

std::condition_variable ServerThreadPool::c_cons
private

◆ c_prod

std::condition_variable ServerThreadPool::c_prod
private

◆ connectionQueue

std::queue<int> ServerThreadPool::connectionQueue
private

◆ ip

std::string ServerThreadPool::ip
private

◆ port

int ServerThreadPool::port
private

◆ queueCapacity

int ServerThreadPool::queueCapacity
private

◆ queueLock

std::mutex ServerThreadPool::queueLock
private

◆ server

MultiThreadedServerInterface* ServerThreadPool::server
private

◆ socketConnection

int ServerThreadPool::socketConnection
private

◆ threadCount

int ServerThreadPool::threadCount
private

◆ threads

std::vector<std::thread> ServerThreadPool::threads
private

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