Coder Social home page Coder Social logo

muduo-study's Introduction

Overview

The repository is for Learning high-performance network library (on Linux) based on Reactor pattern

Muduo is a multithreaded C++ network library based on the Reactor pattern.

Reference

github.com/chenshuo/muduo

Quick Start

Requires

  • cpp-17 least
  • Boost.Endian (A header-only lib for Endian-conversion)
  • GTest (if need to compile unit tests)

Compile

# If need to compile test files, 
# define environment variable "MUDUO_UNIT_TESTS=ON"
# to enable memory-pool
# define environment variable "MUDUO_USE_MEMPOOL=ON"

# See build.sh for details
bash build.sh

Introduction

  • 基于 "事件驱动" 的Reactor网络编程模型
  • 支持多种Reactor模式
    • Single Reactor - 单线程模式
    • Multithreaded Reactor - 主从Reactor模式
    • Multithreaded Reactor + threadPool
  • 采用「one loop per thread」线程模型 + non-blocking IO
  • 基于双缓冲区机制实现异步日志
  • 基于优先队列实现定时器管理结构
  • 遵行"RAII"**,使用智能指针管理内存
  • 参考"SGI STL-allocator"实现了循环级内存池
  • 支持select\poll\epoll 3种 IO-multiplexing

并发模型

Single Reactor

Single Reactor

Multithreaded Reactor + threadPool

Multithreaded Reactor

muduo-study's People

Contributors

linkvvu avatar

Stargazers

 avatar WzT avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.