Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.61 KB

README.md

File metadata and controls

54 lines (37 loc) · 1.61 KB

Introduction

This project implements a server using Linux epoll and thread poll. The thread pool consists of a buffer and multithread mechanism. The buffer is a message queue, which applies producer-consumer model to process requests sent by clients. Mutex is used for multithread in order to avoid deadlock.

epoll provides a simple but high-efficient polling mechanism: (1) epoll_create1 creates a epoll instance; (2) epoll_ctl modifies the file descriptors in epoll instance; (3) epoll_wait is used to wait I/O events.

Usage

  1. when you want architecture to support multiple clients at the same time.

How to get it?

git clone https://github.com/henrytien/threadpool_epoll.git

Building and run

If your system doesn't installed log4cpp, visit Log for C++ Project and you can download and install.

  • building the server cd threadpool_epoll and sh start.sh
  • building the client demo cd client && make && sh client.sh

Design

Here are class diagram and sequence diagram.

  • class diagram class diagram

  • sequence diagram sequence diagram

Examples

  • start three clients server

  • clients clients

  • work work

  • log log

Refrence

  1. cpprefrence
  2. StarUML
  3. GDB
  4. epoll
  5. Class diagram