Giter VIP home page Giter VIP logo

cpp-concurrency-examples's Introduction

C++ Concurrency Examples

学习 C++11 多线程并发编程的过程中编写的一些 Demo,用于演示 C++11 标准线程库的用法。

  • spinlock/:使用 std::atomic_flag 实现一个简单的自旋锁
  • threadsafe_queue/:使用 std::mutexstd::condition_variable 实现一个简单的线程安全的队列
  • thread_pool/:使用 std::packaged_taskstd::future 实现一个简单的线程池
  • producer_consumer/:基于有限阻塞队列实现生产者消费者模型

编译环境:

  • Ubuntu 22.04
  • g++ 11.3.0
  • C++17

主要参考资料:《C++ 并发编程实战》(第二版)。

TODO

  • 线程安全队列的无锁实现。

cpp-concurrency-examples's People

Contributors

atomicvar avatar

Stargazers

 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.