[issue18049] Re-enable threading test on macOS
Ronald Oussoren
report at bugs.python.org
Sun Jul 14 04:38:58 EDT 2019
Ronald Oussoren <ronaldoussoren at mac.com> added the comment:
I've done some more testing, and the thread stack size could be smaller than 16MB, but definitely not as small as the value that's currently in thread_pthread.h.
I prefer to have a slightly too large value here because IIRC the relation between the recursion limit and C stack usage is a heuristic.
BTW. It should be possible to implement PyOS_CheckStack() on macOS. There are (undocumented) APIs in the public header files to get the stack base and size for the current thread. These APIs also work for the main thread:
# ---
#include <pthread.h>
#include <stdio.h>
int main(void)
{
printf("%#lx\n", (long)pthread_get_stacksize_np(pthread_self()));
printf("%p\n", pthread_get_stackaddr_np(pthread_self()));
}
# ---
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18049>
_______________________________________
More information about the Python-bugs-list
mailing list