楼主: Reader's
2440 3

C++ Concurrency in Action [推广有奖]

  • 0关注
  • 0粉丝

已卖:1521份资源

博士生

59%

还不是VIP/贵宾

-

TA的文库  其他...

可解釋的機器學習

Operations Research(运筹学)

国际金融(Finance)

威望
0
论坛币
41198 个
通用积分
2.6173
学术水平
7 点
热心指数
5 点
信用等级
5 点
经验
2201 点
帖子
198
精华
1
在线时间
36 小时
注册时间
2015-6-1
最后登录
2024-3-3

楼主
Reader's 发表于 2015-6-1 02:10:11 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


Book Description
Without assuming you have a background in the subject, C++ Concurrency in Action gradually enables you to write robust and elegant multithreaded applications in C++11. You'll explore the threading memory model, the new multithreading support library, and basic thread launching and synchronization facilities. Along the way, you'll learn how to navigate the trickier bits of programming for concurrency.

Written for C++ programmers who are new to concurrency and others who may have written multithreaded code using other languages, APIs, or platforms.

Book Details
Publisher:        Manning
By:        Anthony Williams
ISBN:        978-1-9339-8877-1
Year:        2012
Pages:        528
Language:        English
File size:        6.7 MB
File format:        PDF
Download:     

本帖隐藏的内容

C++ Concurrency in Action.rar (3.09 MB, 需要: 20 个论坛币) 本附件包括:
  • C++ Concurrency in Action.pdf





二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:currency Action curr Ency ACT background facilities launching navigate explore

本帖被以下文库推荐

沙发
liubingzsd(未真实交易用户) 发表于 2015-6-1 11:39:39

Listing 3.1 Protecting a list with a mutex

  1. #include <list>
  2. #include <mutex>
  3. #include <algorithm>
  4. std::list<int> some_list;
  5. std::mutex some_mutex;
  6. void add_to_list(int new_value)
  7. {
  8. std::lock_guard<std::mutex> guard(some_mutex);
  9. some_list.push_back(new_value);
  10. }
  11. bool list_contains(int value_to_find)
  12. {
  13. std::lock_guard<std::mutex> guard(some_mutex);
  14. return std::find(some_list.begin(),some_list.end(),value_to_find)
  15. != some_list.end();
  16. }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

藤椅
condmn(未真实交易用户) 发表于 2015-6-1 17:10:32

Listing 3.2 Accidentally passing out a reference to protected data

  1. class some_data
  2. {
  3. int a;
  4. std::string b;
  5. public:
  6. void do_something();
  7. };
  8. class data_wrapper
  9. {
  10. private:
  11. some_data data;
  12. std::mutex m;
  13. public:
  14. template<typename Function>
  15. void process_data(Function func)
  16. {
  17. std::lock_guard<std::mutex> l(m);
  18. func(data);
  19. }
  20. };
复制代码
  1. some_data* unprotected;
  2. void malicious_function(some_data& protected_data)
  3. {
  4. unprotected=&protected_data;
  5. }
  6. data_wrapper x;
  7. void foo()
  8. {
  9. x.process_data(malicious_function);
  10. unprotected->do_something();
  11. }
复制代码

板凳
Nicolle(未真实交易用户) 学生认证  发表于 2016-8-1 21:18:54

Listing 3.4 An outline class definition for a thread-safe stack

提示: 作者被禁止或删除 内容自动屏蔽

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2026-1-4 01:16