[Python-Dev] Re: Question regarding the value of PyThreadState.thread_id

2021-04-17 Thread Gabriele
Hi Victor Thanks for your reply. Indeed, upon further investigation, I have realised changing the value of thread_id is not wise as there are other methods that expect this field to be a pthread_t. I have opened issue https://bugs.python.org/issue43879https://bugs.python.org/issue43879 to have the

[Python-Dev] Re: Question regarding the value of PyThreadState.thread_id

2021-04-17 Thread Victor Stinner
Hi, There are two reasons: * PyThread_get_thread_native_id() was only added recently (Python 3.8) * PyThread_get_thread_native_id() is not portable and not available on all platforms: the function is only declared if the PY_HAVE_THREAD_NATIVE_ID macro is defined. Maybe PyThreadState.thread_id co