This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients Michael.Felt, jaketesler, pitrou, vstinner
Date 2019-05-22.07:54:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558511688.43.0.466057663332.issue36084@roundup.psfhosted.org>
In-reply-to
Content
Repeating a bot of what I added to PR13463

AIX has native support for thread-id since at least AIX 4.1 (1994-1995) where every process has an initial TID (PID are even numbers and "own" the resources, TID are odd and are the "workers" - very simply put). Hence, by default, an AIX process is "mono-threaded".

The key concern - when calling thread related issues, is to ensure that all compiled code uses the same definitions in include files - namely, with _THREAD_SAFE defined.

There are couple of ways to accomplish this:
a) ensure that #include <pthread.h> is first (everywhere!)
b) use cc_r, xlc_r, etc_r (with IBM compiler)
c) -D_THREAD_SAFE

As a) seems unpractical to ensure all the time; b) is also unpractical (no idea how/if gcc, e.g., has a way to 'signal' the need to be thread_safe - so a change in configure.ac, and maybe in setup.py, and thinking further yet - in the CFLAGS that get passed to extrnal modules and extensions - adding -D_THREAD_SAFE seems the most complete (aka safe) approach.

And, of course, for this specific function a call to

Syntax
#include <pthread.h>
pthread_t pthread_self (void);

Description
The pthread_self subroutine returns the calling thread's ID.
History
Date User Action Args
2019-05-22 07:54:48Michael.Feltsetrecipients: + Michael.Felt, pitrou, vstinner, jaketesler
2019-05-22 07:54:48Michael.Feltsetmessageid: <1558511688.43.0.466057663332.issue36084@roundup.psfhosted.org>
2019-05-22 07:54:48Michael.Feltlinkissue36084 messages
2019-05-22 07:54:47Michael.Feltcreate