pthread_exit behavior from main

Siddhesh Poyarekar
Fri Oct 5 02:15:00 GMT 2012

(Sorry, accidentally did a Reply instead of Reply All)

On 5 October 2012 07:11, Godmar Back <> wrote:
> Just out of curiosity, why do you madvise it with MADV_DONTNEED rather
> than munmapping it outright?

That's a performance tweak.  The pthread library caches a specific
number of stacks so that they can be reused by new threads, thus
avoiding the need for repeated syscalls.


More information about the Libc-help mailing list