# ConcurrencySample **Repository Path**: bethjohanssen/concurrency-sample ## Basic Information - **Project Name**: ConcurrencySample - **Description**: “C++多线程编程应用介绍(介绍语法、实际应用注意点等)”技术分享的示例代码。 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 1 - **Created**: 2021-02-02 - **Last Updated**: 2021-06-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ConcurrencySample #### 介绍 “C++多线程编程应用介绍(介绍语法、实际应用注意点等)”技术分享的示例代码。 #### 清单 ##### docs 存储的是本次技术分享的PPT文件。 ##### thread * thread_1.cpp 一个简单的创建线程程序 * thread_2.cpp 使用RAII方式等待线程完成 * thread_3.cpp 传递参数 * thread_4.cpp 转移所有权 * thread_5.cpp 线程管理类 ##### mutex * mutex_1.cpp 使用互斥量保护列表 * mutex_2.cpp 无意中传递了保护数据的引用 * mutex_3.cpp once_flag once_flag * mutex_4.cpp thread_local > condition_variable * condition_variable_1.cpp 处理数据等待 ##### future * future_1.cpp 后台任务的返回值 * future_2.cpp 使用async向函数传递参数 * future_3.cpp promises * future_4.cpp packaged_task * future_5.cpp shared_future * future_6.cpp packaged_task图形界面线程示例 ##### 其余 * parallel_accumulate.cpp 并行化累加算法 * threadsafe_queue.cpp 线程安全的queue容器 * threadsafe_stack.cpp 线程安全的stack容器 #### 参考资料与推荐读物 * [cppreference 线程支持库](https://zh.cppreference.com/w/cpp/thread) * [C++11 并发指南系列](https://www.cnblogs.com/haippy/p/3284540.html) * [C++并发编程(从C++11到C++17)](https://paul.pub/cpp-concurrency/#id-%E8%BF%9B%E7%A8%8B%E4%B8%8E%E7%BA%BF%E7%A8%8B) * [《C++ Concurrency in Action - SECOND EDITION》中文翻译](https://github.com/xiaoweiChen/CPP-Concurrency-In-Action-2ed-2019) * [《Effective Modern C++》中文翻译](https://github.com/kelthuzadx/EffectiveModernCppChinese)