What exactly does `threading=multi` do when compiling boost?

后端 未结 4 1990
清酒与你
清酒与你 2021-01-02 03:01

I am not entirely sure what exactly the threading=multi flag does when building boost. The documentation says:

 Causes the produced binaries to          


        
4条回答
  •  一生所求
    2021-01-02 03:15

    Let's be concise. Causes the produced binaries to be thread-safe means that Boost code is adapted to that different threads can use different Boost objects. That means in particular that the Boost code will have a special care of the thread-safety of accesses to hidden global or static objects that might be use by the implementation of Boost libraries. It does not automatically allow different threads to use the same Boost objects at the same time without protection (locks/mutexes/...).

    Edit: Some Boost libraries may document an extra thread-safety for specific functions or classes. For example asio::io_service as suggested by Igor R. in a comment.

提交回复
热议问题