C ++ 11 Thread vs Boost Thread有什么区别? [英] C++ 11 Thread vs Boost Thread is there any difference?

查看:169
本文介绍了C ++ 11 Thread vs Boost Thread有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用C ++ 11多线程类与使用Boost中的类相比有什么优点/缺点?我将仅使用Linux,因此不需要可移植性.其中一个库是否缺少功能?有任何已知的限制吗?更好的语法?

What are the advantages/disadvantages of using the C++11 multithreading classes versus the ones found in Boost? I will only be using Linux so I do not require portability. Is there a lack of features in one of the libraries? Any known limitations? Better syntax?

推荐答案

标准线程具有标准化的优点,因此可以移植到任何兼容的实现中.

Standard threads have the advantage of being standardised, therefore portable to any compliant implementation.

Boost线程库或多或少是相同的;标准库是基于该库的,并且已经在努力使Boost成为该标准的一致实现.它具有一些可能有用的扩展,包括:

The Boost thread library is more or less identical; the standard library was based on that library, and there has been an effort to make Boost a conformant implementation of the standard. It has a few extensions which might be useful, including:

  • join超时
  • 线程中断
  • 线程组
  • 额外锁定类型
  • join with timeout
  • thread interruption
  • thread groups
  • extra lock types

这篇关于C ++ 11 Thread vs Boost Thread有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆