- Scalability. Problems of scalability arise when using memory allocators originally designed for serial programs, on threads that might have to compete for a single shared pool in a way that allows only one thread to allocate at a time.Use thescalable_allocator<T>template to avoid scalability bottlenecks. This template can improve the performance of programs that rapidly allocate and free memory.
- False sharing. Problems of sharing arise when two threads access different words that share the same cache line. The problem is that a cache line is the unit of information interchange between processor caches. If one processor modifies a cache line and another processor reads the same cache line, the line must be moved from one processor to the other, even if the two processors are dealing with different words within the line. False sharing can hurt performance because cache lines can take hundreds of clocks to move.Use thecache_aligned_allocator<T>template to always allocate on a separate cache line. Two objects allocated bycache_aligned_allocatorare guaranteed to not have false sharing. However, if an object is allocated bycache_aligned_allocatorand another object is allocated some other way, there is no guarantee.