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

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

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

相关标签:
15条回答
  • 2021-02-06 11:37

    unfortunately there is no easy way. Couple of options: pthread on linux, win32 api threads on windows or boost::thread library

    0 讨论(0)
  • 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).

    0 讨论(0)
  • 2021-02-06 11:41

    I would say with Qt. Qt Threads and Qt Concurrency are probably worth googling.

    0 讨论(0)
提交回复
热议问题