PThread 与 boost::thread?

2021-12-24 00:00:00 multithreading posix c++ pthreads boost

在过去没有线程经验的情况下,C++ 中的哪种线程技术对初学者来说是最容易的?boost::thread 还是 pthreads?

Having no experience with threading in the past, which threading technique in C++ will be the easiest for a beginner? boost::thread or pthreads?

推荐答案

转到 boost::thread.它与密切相关即将推出的 C++ 标准线程,并且界面非常易于使用和习惯于 C++(RAII 而不是手动资源管理).

Go for boost::thread. It's closely related to the work on the upcoming C++ standard threads, and the interface is quite easy to use and idiomatic to C++ (RAII instead of manual resource management).

相关文章