This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14829] sched_* functions wrongly alter thread scheduling, rather than process

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

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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]