Good c++ lib for threading

后端 未结 4 552
小蘑菇
小蘑菇 2021-01-06 11:02

I prefer a lib solely based on pthreads. What is a good c++ lib to for threading?

相关标签:
4条回答
  • 2021-01-06 11:28

    Also, also, if you need some concurrency, but don't want to play that much with the threads, then you could look at Thread Building Blocks.

    0 讨论(0)
  • 2021-01-06 11:30

    How about boost threads?

    Boost.Thread enables the use of multiple threads of execution with shared data in portable C++ code. It provides classes and functions for managing the threads themselves, along with others for synchronizing data between the threads or providing separate copies of data specific to individual threads.

    0 讨论(0)
  • 2021-01-06 11:36

    I looked at some options some time ago. Here are some:

    • Boost Thread - This is the most standard choice. Boost is the most standard library for C++, that is not in the official standard.
    • POCO - Has thread support and a lot more. Is my preferred choice because it lets you set thread priorities, something boost doesn't support. Thread priorities are important for my application domain (soft real-time).
    • Zthread - Looks a good library. I have no experience with it.
    • ACE - Well known library. I have no experience with it.

    Then you have libraries that let you operate at an higher abstraction level like Thread Buildings Blocks.

    0 讨论(0)
  • 2021-01-06 11:41
    • Boost Threads seems a pretty obvious suggestion.
    • Also if you need some concurrency, but don't want to play that much with the threads, than maybe Futures (see also Boost mailing lists)?
    0 讨论(0)
提交回复
热议问题