What is easiest way to create multithreaded applications with C/C++?

前端 未结 15 1751
遥遥无期
遥遥无期 2021-02-06 11:05

What is the easiest way to create multithreaded applications with C/C++?

15条回答
  •  Happy的楠姐
    2021-02-06 11:37

    This depends entirely on what you're doing. If you can fit what you're doing into OpenMP then that is the way to go. Otherwise you may want to look at Intel's TBB. TBB offers several workflows which you should be able to fit into, but the library is dual licensed and you may not be able to accept either license. If both OpenMP and TBB are out, then you should consider your operating system's thread pools abilities.

    At some point you may need to bite the bullet and use Boost.Thread. If so, you'll want to look at what makes multithreading in C++ hard (good to read even if you're not using C++0x: "It's not the threads themselves, it's the communication that causes problems. Mutable shared state introduces implicit communication," page 3).

提交回复
热议问题