Coder Social home page Coder Social logo

ultramultithread's Introduction

Ultra Multi-Thread

本项目旨在通过命名共享对象的方式,便捷化和模块化多线程编程。同时提供各类常用多线程同步功能,对标准库进行二次封装。代码header only,但会依赖部分第三方库作为辅助功能。


针对多线程编程的几个痛点:

  • 共享数据直接使用全局变量:代码不具有良好的模块化结构,文件依赖关系繁杂。
  • 共享数据使用堆上动态分配对象:shared_ptr在各个函数中层层传递,代码结构容易混乱。
  • 标准库只有较底层的线程同步库:常用的高级同步方式总是要造轮子。

使用命名共享对象的方式,省去shared_ptr的层层传递,同时不会像直接使用全局对象那样是的代码依赖繁杂。命名共享对象,通过对象类型和对象名称唯一确定一个共享对象,通过字符串哈希表来寻找对应的共享对象。


常用多线程同步功能:

  • 发布订阅模式(配合boost.python导出python模块,可以更好的实现模块化和插件化)
  • 线程条件休眠与唤醒

主要功能和函数的使用可以查看example

ultramultithread's People

Contributors

xinyang-go avatar

Stargazers

sylybimike2001 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.