4 ms·
> When multiple threads simultaneously allocate or deallocate memory from the allocator, the allocator will serialize them. Memory allocators designed for mult
by scott_s 7y ago
> When multiple threads simultaneously allocate or deallocate memory from the allocator, the allocator will serialize them.
Memory allocators designed for multithreaded use will not serialize allocations and frees. Such allocators use thread-local data structures and try to avoid touching non-thread-local structures that require synchronization. I am "S. Schneider, 2006" and that was one of the main points of that paper. Modern memory allocators (tcmalloc, jemalloc, even I believe modern glibc) follow similar designs.
- egberts1 7y agoAye, such evolution tracking we must do for the history of malloc; Thanks, Scott. Evolution doesn’t always means most efficient or better. :-)