Message303470
> 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. |
|
Date |
User |
Action |
Args |
2017-10-01 17:34:52 | pitrou | set | recipients:
+ pitrou, tim.peters, ncoghlan, r.david.murray, pdox |
2017-10-01 17:34:52 | pitrou | set | messageid: <1506879292.55.0.213398074469.issue31622@psf.upfronthosting.co.za> |
2017-10-01 17:34:52 | pitrou | link | issue31622 messages |
2017-10-01 17:34:52 | pitrou | create | |
|