Message303487
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. |
|
Date |
User |
Action |
Args |
2017-10-01 19:34:10 | benjamin.peterson | set | recipients:
+ benjamin.peterson, tim.peters, ncoghlan, pitrou, r.david.murray, pdox |
2017-10-01 19:34:10 | benjamin.peterson | link | issue31622 messages |
2017-10-01 19:34:10 | benjamin.peterson | create | |
|