Introduction

The project uses Linux epoll and thread poll build the server and have a client demo.
the thread pool has two-part, one is buffer, like a message queue, use a producer-consumer model implement by condition, and the other is multithread by with mutex 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.

Requirements

  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
    threadpoll epoll implementing server

  • sequence diagram
    threadpoll epoll implementing server

Examples

Refrence

[1]cpprefrence
[2]StarUML
[3]GDB
[4]epoll
[5]Class diagram

相关文章:

  • 2021-10-04
  • 2021-07-26
  • 2021-05-18
  • 2021-10-27
  • 2021-05-09
  • 2021-11-10
  • 2022-01-02
猜你喜欢
  • 2021-04-15
  • 2021-06-13
  • 2021-08-21
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案