[issue18049] Re-enable threading test on macOS

Michael Felt report at bugs.python.org
Fri Aug 2 05:09:46 EDT 2019


Michael Felt <aixtools at felt.demon.nl> added the comment:

*** 
Looking in ./Python/thread_pthread.h"

  +252  #if defined(THREAD_STACK_SIZE)
  +253      PyThreadState *tstate = _PyThreadState_GET();
  +254      size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0;
  +255      tss = (stacksize != 0) ? stacksize : THREAD_STACK_SIZE;
  +256      if (tss != 0) {
  +257          if (pthread_attr_setstacksize(&attrs, tss) != 0) {
  +258              pthread_attr_destroy(&attrs);
  +259              return PYTHREAD_INVALID_THREAD_ID;
  +260          }
  +261      }
  +262  #endif

It appears asif the call needed (for AIX) - thread_attr_setstacksize(&attrs, tss) should be occurring.

Can you help me with a quick program that reports back the actual stack size an AIX thread has?

What may be at the heart of this (assuming the call above is working as expected) - the default memory size for AIX 32-bit is 256MB. Assuming 16 to 32MB is already in use - if I understand this "recurse" logic - after about 12-14 recursions the 256MB is consumed.

In short (work calls) - it seems the API mentioned is already in place and what is happening in terms of "exception catching" is different.

Looking forward to hints on how to dig further.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18049>
_______________________________________


More information about the Python-bugs-list mailing list