I’m new to C++ (coming from C#) writing a multi-threaded C++ application and wondering what is better to use: std::thread or its Boost counterpart?
I saw the following discussion in another Stack Overflow post, but still do not have the complete picture of why should I choose one over the other. If not starting a new program, should I use standard library or Boost threads?
Thanks!
If you’re not already using boost in your project, there is no reason to use boost::thread in favor of std::thread. That is unless you are using some feature from boost not available in the STL. std::thread is suitable enough for most use cases, and unless compelling arguments are presented, writing standard code is always preferable.
If however you are already using boost in your project, check out if boost::thread offers anything extra compared to std::thread.