[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

STINNER Victor report at bugs.python.org
Tue Sep 13 19:55:50 CEST 2011

STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> However, I don't think we should/could add this to the posix module: 
> it expects a pthread_t instead of a PID, to which we don't have access.

We already have such function:

I added threading.get_ident() to easily get the thread identifier. In Python < 3.3, you can use threading.current_thread().ident.

It's not documented, but if you pass a random integer, signal.pthread_kill() does crash.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list