This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What can a thread do with PTHREAD_STACK_MIN?


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
thread again.

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
minimum.

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.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]