News for hackers. Stuff that matters.
Re:How fast can you allocate a large block of memory in C++? by usefulcat on Thursday January 16, 2020 @08:43AM (#22064396)
> If your program has threads, unmapping memory is generally to be avoided.

Could you expand on this? I recently encountered a situation where allocating and freeing many large allocations using mmap() seemed to eventually cause problems with thread creation, but I had assumed that it was probably because the virtual address space had become too fragmented, which of course would not solely be a result of unmapping. Or maybe that fragmentation is what you're referring to, and I'm just reading too much into that sentence.

Re:How fast can you allocate a large block of memory in C++? by ncmncm on Thursday January 16, 2020 @09:33AM (#22064834)
It just creates long stalls as the TLBs of all cores that threads in the process run on are flushed and must be reloaded from backing RAM.