Benjamin Peterson <benja...@python.org> added the comment: On Sun, Oct 1, 2017, at 12:25, Antoine Pitrou wrote: > Another possibility would be to have a new separate threading API > returning a "low-level opaque thread handle" that you could pass to > pthread_kill() and pthread_getcpuclockid(). threading.get_ident() could > still be used for logging purposes and others. > > A related issue: what if you want to call pthread_kill() on a non-Python > thread?
C code that provides pthread_t to Python would have to wrap it. > > > I suppose, though you can't usefully use it as an integer. I imagine a > > comparable and hashable opaque object would be compatible with most > > code. > > What happens for code that uses e.g. "%x" to format thread ids? It's okay for the opaque object to have a int() conversion. The important part is that threading apis don't accept ints. ---------- _______________________________________ 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