Hacker News new | ask | show | jobs
by senderista 17 hours ago
In typical modern allocators like jemalloc or tcmalloc[*], sharded arenas are protected by locks, but the assumption is that with enough sharding there won't be significant lock contention, and also that you can mostly avoid the locks with thread-local caches. (mimalloc uses thread-local arenas instead, so no locks are required for allocations, and atomic RMW ops for cross-thread frees.)

* I'm ignoring rseq here for simplicity.