[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

Charles-François Natali report at bugs.python.org
Wed Aug 31 20:48:50 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

There's no reason to disable sched_get_priority_(min|max) when Python is built without threads: those libraries control the scheduling policy, and should be available even without pthread.
However, it's really likely that pthread has its own implementation (especially since OpenBSD's threads are implemented in user-space), and it seems that OpenBSD sched_get_priority() is only defined for threads:
http://www.openbsd.org/cgi-bin/man.cgi?query=sched_get_priority_max&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html
"""
This implementation does not support process scheduling.
"""

For example, the following snippet builds correctly on Linux:

"""
#include <sched.h>


int main(int argc, char *argv[])
{
    int (*fp)(int) = sched_get_priority_max;

    return 0;
}
"""

So this should be skipped only on OpenBSD, or we should add some checks to the configure script.

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12871>
_______________________________________


More information about the Python-bugs-list mailing list