| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
12年前发布

C++11的并发框架:Async++

Async++是一个轻量级的C++11并发框架。其思想源于Microsoft PPL libraryN3428 C++标准提案。

// Create a task which runs asynchronously  auto my_task = async::spawn([] {      return 42;  });    // Do other stuff while the task is not finished  while (!my_task.ready()) {      // Do stuff...  }    // Wait for the task to complete without getting the result  my_task.wait();    // Wait for the task to complete and get the result  int answer = my_task.get();    // Create a task with a preset value  auto my_task2 = async::make_task(42);    // Print the value stored in the task  std::cout << my_task2.get() << std::endl;

项目主页:http://www.open-open.com/lib/view/home/1362732394968

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1362732394968.html
并发 C/C++开发