Antoine Pitrou <pit...@free.fr> added the comment:

> On a system with pthreads, the thread_id that Python provides is merely 
> pthread_t casted to unsigned long. This works today, but is in violation of 
> the standard, and could break on systems with exotic pthread_t.

I don't think that follows.  Even if pthread_t is not an integer, it does have 
a binary representation that can be trivially converted to a arbitrary-sized 
Python int in Python-facing APIs such as threading.get_ident().

(and similarly, of course, for converting in the other direction e.g. for 
pthread_kill())

> There is also the ability to introduce undefined behavior, such as sending a 
> signal to an invalid thread id:

I wouldn't worry much about pthread_kill(), a little-used feature.

----------
nosy: +tim.peters

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

Reply via email to