Can multithreading speed up memory allocation?

前端 未结 10 2349
感情败类
感情败类 2020-12-05 03:29

I\'m working with an 8 core processor, and am using Boost threads to run a large program. Logically, the program can be split into groups, where each group is run by a threa

10条回答
  •  借酒劲吻你
    2020-12-05 04:02

    You need to check your compiler documentation whether it makes the allocator thread safe or not. If it does not, then you will need to overload your new operator and make it thread safe. Else it will result in either a segfault or UB.

提交回复
热议问题