What can a thread do with PTHREAD_STACK_MIN?

DJ Delorie dj@redhat.com
Thu Dec 21 16:57:00 GMT 2017


"Carlos O'Donell" <carlos@redhat.com> writes:
> I would like to get consensus on what a thread can do with
> PTHREAD_STACK_MIN amount of stack.

As a programmer, if I read "this is the minimum stack size" I assume
they included all their own overhead for normal "minimum user cases".

I.e. a thread that's created, does some processing that doesn't use
stack, ends, and is joined.

The programmer can't predict what glibc will need for its own overhead,
so specifying a minimum any less than needed for the above is pointless.

I don't know if this needs to include cancellation; I don't think I've
ever cancelled a thread in my entire programming career so I wouldn't
consider this "minimal".  However, I (as a programmer) also wouldn't
expect a cancellation initiated by another thread to impact the stack
usage of the cancelled thread, although in hindsight if signal handlers
are involved...



More information about the Libc-alpha mailing list