This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14829] sched_* functions wrongly alter thread scheduling, rather than process
- From: "carlos at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 14 Jun 2013 16:36:47 +0000
- Subject: [Bug libc/14829] sched_* functions wrongly alter thread scheduling, rather than process
- Auto-submitted: auto-generated
- References: <bug-14829-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14829
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |carlos at redhat dot com
--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
I agree that this a mess in Linux right now.
I agree that most of the sched_* functions should actually do nothing in glibc,
principally because process level contention scheduling is not supported.
At present these functions change the scheduling for the thread leader whose
tid == tgid and which is returned from the call to getpid(). I agree that this
is wrong according to POSIX. Thus the functions do not operate as required by
POSIX for threaded applications
These functions do operate correctly for non-threaded applications.
One solution is to version the interfaces, and have all of the new version do
nothing if threads are active.
When Linux gets proper process scheduling support we can stop doing nothing and
do the right sequence of operations to set the pid's (or tgid's) scheduling
parameters.
Linux needs to be enhanced to do the following:
- getpid returns pid
- gettid returns tid != pid
All processes whould start off with a unique tgid that can be used as the
target of these calls and that is returned via getpid, and that can't be
confused with the thread leader.
That would allow these calls to identify the tgid uqiquely.
--
You are receiving this mail because:
You are on the CC list for the bug.