Hacker News new | ask | show | jobs
by zabzonk 2321 days ago
> malloc takes out a global lock

Says who? The C Standard says nothing of the kind.

1 comments

All modern common implementations (I think). MSVC's malloc definitely locks. I think gcc, clang and icc do too. This is a big reason why tcmalloc and jemalloc were created.
I don't know about MSVC, but glibc malloc has per thread caches. At some point you need to hit the global allocator or sbrk or mmap of course and that might take a global lock.