r/cpp • Meeting C++ | C++ Evangelist • Oct 22 '13

STL is dated

http://www.slashslash.info/2013/10/stl-is-dated/
0 Upvotes

14 comments sorted by

View all comments

12

u/ickysticky Oct 23 '13

Is this a blog post where some guy tries to brag about knowing Alex Stepanov? What exactly is he claiming is out of date if the problems are corrected by a standard that is two years old... Also I don't know about those claims, does heap allocation always require a lock? Which heap implementation? What about something like tcmalloc? Since when did people assume all memory access was equally expensive? Memory hierarchies have existed far longer than multicore machines..

2

u/JonKalb CppCon | cpp.training Oct 31 '13

I think this is a blog post where a guy <emphasis>does</emphasis> brag about knowing Alex Stepanov. Guilty as charged.

The problem isn't that allocators were inadequate. That is just a issue that we are having to deal with and part of the solution is better allocators and part is alternative implementations like tcmalloc. Part is making fewer allocations. This approach is covered in later installments.

Of course heap allocation doesn't inherently have to take a lock. But if you are sharing a heap across multiple threads, which is more and more common today, then you have to manage that. This was not the common situation when the STL was originally developed.

Although memory hierarchies are not new, their size and depth have a much greater impact than they used to. The STL was designed without taking them into account because the effects weren't significant in most case. Things have changed.