Can multithreading speed up memory allocation?

前端 未结 10 2381
感情败类
感情败类 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:09

    On some platforms like Windows, access to the global heap is serialized by the OS. Having a thread-separate heap could substantially improve allocation times.

    Of course, in this case, it might be worth questioning whether or not you genuinely need heap allocation as opposed to some other form of dynamic allocation.

提交回复
热议问题