Jakub Kulik <jakub.ku...@oracle.com> added the comment:

Ah, sorry, I could have described the issue better. It's not a problem with 
exporting, PyThread_get_thread_native_id() isn't available on Solaris (and 
possibly other platforms) at all.

https://github.com/python/cpython/blob/main/Include/pythread.h#L28
https://github.com/python/cpython/blob/main/Python/thread_pthread.h#L329

The reason I didn't implement it yet is that Solaris doesn't expose anything 
like native thread id. We do have functions like `_lwp_self()` or 
`pthread_self()` or `thr_self()` but neither of them returns id where "value 
may be used to uniquely identify this particular thread system-wide". (I 
presume that means that no other thread of no other process running on a given 
system would return the same number - all these functions return single digit 
numbers so there is no way they are unique system wide).

If necessary, I guess that such a number can be created by masking pid and 
thread id together, but then there's a question of how it is supposed to be 
used (because OS would not understand it).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44133>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to