Message143984
Charles-François Natali <report@bugs.python.org> wrote:
> Out of curiosity, I just looked at the source code, and it just does
> sched_setaffinity(thread->tid), so you can do the same with
> sched_setaffinity(syscall(SYS_gettid)) for the current thread.
sched_setaffinity(syscall(SYS_gettid), size, cpusetp) crashes, too.
This seems to be a violation of the man page, which states:
"The value returned from a call to gettid(2) can be passed in
the argument pid."
Unless one uses a somewhat warped interpretation that linking
against pthread constitutes "using the POSIX threads API". That
would be the only loophole that would allow the crash.
> 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.
If we have access (and as I understood from Victor's post we do):
pthread_getaffinity_np() also exists on FreeBSD, which would be
an advantage.
> So I'd suggest closing this issue.
I don't care strongly about using pthread_getaffinity_np(), but at least I'd
like to skip the scheduling sections on arm-linux if they don't work reliably. |
|
Date |
User |
Action |
Args |
2011-09-13 19:13:59 | skrah | set | recipients:
+ skrah, vstinner, benjamin.peterson, meador.inge, neologix |
2011-09-13 19:13:59 | skrah | link | issue12936 messages |
2011-09-13 19:13:58 | skrah | create | |
|