Is there any cross-platform threading library in C++?

前端 未结 12 1023
小鲜肉
小鲜肉 2020-12-14 01:36

I\'m looking for some easy to use cross-platform threading library written in C++.

What\'s your opinion on boost::thread or Pthreads? Does

12条回答
  •  爱一瞬间的悲伤
    2020-12-14 01:58

    There is a threading library coming with C++11. It's built upon the boost threading library. Unfortunately, I seem to remember that there are non-trivial differences between Boost.Threads and what C++11 comes with. Still, if you plan to switch to the C++ standard threading library, I believe Boost.Threads is the closest you can get to now.

    I suppose that, under the hood, these libraries will use Pthreads on POSIX systems and whatever native threading support is available elsewhere.

    Disclaimer: I haven't worked with either of the two.

提交回复
热议问题