This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/7013] New: Policies permitted by pthread_attr_setschedpolicy() inconsistent with pthread_setschedparam()
- From: "mtk dot manpages at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 6 Nov 2008 16:18:31 -0000
- Subject: [Bug nptl/7013] New: Policies permitted by pthread_attr_setschedpolicy() inconsistent with pthread_setschedparam()
- Reply-to: sourceware-bugzilla at sourceware dot org
In nptl/pthread_attr_setschedpolicy.c there are the lines
/* Catch invalid values. */
if (policy != SCHED_OTHER && policy != SCHED_FIFO && policy != SCHED_RR)
return EINVAL;
In pthread_setschedparam(), there is not an analogous check.
This means that one can set, for example, a SCHED_BATCH policy with
pthread_setschedparam(), but one can't initialize a thread attributes object
that can be used to create a thread running under the SCHED_BATCH policy.
This seems rather inconsistent. Either pthread_setschedparam() should place the
same restriction as pthread_attr_setschedpolicy(), or the restriction should be
removed from pthread_attr_setschedpolicy(). Given that the POSIX.1
specification of pthread_attr_setschedpolicy() says:
The supported values of policy shall include SCHED_FIFO,
SCHED_RR, and SCHED_OTHER, which are defined in the <sched.h>
header.
removing the restriction from pthread_attr_setschedpolicy() seems the more
reasonable course, so that applications can take advantage of the additional
scheduling policies provided by Linux.
--
Summary: Policies permitted by pthread_attr_setschedpolicy()
inconsistent with pthread_setschedparam()
Product: glibc
Version: 2.8
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: mtk dot manpages at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=7013
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.