This is the mail archive of the
mailing list for the glibc project.
Re: What can a thread do with PTHREAD_STACK_MIN?
- From: Florian Weimer <fweimer at redhat dot com>
- To: Carlos O'Donell <carlos at redhat dot com>, DJ Delorie <dj at redhat dot com>
- Cc: szabolcs dot nagy at arm dot com, libc-alpha at sourceware dot org, hjl dot tools at gmail dot com
- Date: Thu, 21 Dec 2017 21:10:31 +0100
- Subject: Re: What can a thread do with PTHREAD_STACK_MIN?
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com>
On 12/21/2017 06:09 PM, Carlos O'Donell wrote:
Therefore I would propose an addendum about cancellation:
The implementation only guarantees that a thread with PTHREAD_STACK_MIN
can be created, but such space does not take into consideration the
thread's stack requirements to execute the start routine. No additional
space, beyond that for the start routine, should be required to join the
Therefore for a thread to be both startable and joinable it must have
PTHREAD_STACK_MIN stack and the stack required for start routine as a
The value of PTHREAD_STACK_MIN does not include enough stack for the
thread in question to be cancelled. Cancellation requires an additional
unspecified amount of stack that depends on the cancellation handlers
to run and when the cancellation is acted upon.
I think this should mention signal handlers (including signals which are
send to the process and may randomly end up on this thread), lazy
binding, and, at least for now, static TLS.
I'm also not sure where we would put this information, due to the
general lack of pthread documentation.