Bug 89066
Summary: | Can not set thread priority using shared library version of glibc/pthreads | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Arun Singh <arun_singh> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED WONTFIX | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 9 | CC: | fweimer, shuston | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2003-04-21 23:20:07 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Arun Singh
2003-04-17 03:49:02 UTC
Created attachment 91168 [details]
Program to change the priority of a thread
Compile this program on Redhat Linux 9 and link it statically and dynamically.
When you run this program, the results are different. The dynamically linked
program is not able to set the thread priority correctly.
The statically linked program sets the priority properly.
The new thread code does not support thread priorities since it's pointless. The necessary kernel interfaces don't exist. At some point there might be a variant of the thread library with the necessary support but the current behavior is as designed. No bug. 1. pthread_attr_setschedparam(...) is a POSIX standard interface function. What do you mean by "thread priorities are pointless"? If it does not make sense then why are we still able to set thread priority through pthread_setschedparam(...) function call from inside the thread? 2. If kernel interfaces do not exist why does setting the priority work when we use the pthreads static library? The behavior should be identical with both the static or dynamic library. Either it should work or it should not work. What I wrote is very clear, you simply are unwilling to read it: The interfaces are pointless since the kernel is missing the support. This is not the normal priority code which is there, but the wakeup from the kernel functionality which is used to implement the synchronization primitives. All the RT stuff is 100% optional. Therefore an implementation is not buggy if it does not provide the support. There is no bug. Closed. But the implementation is buggy if it reports success when requested functionality is not implemented. In the original attached program, for example, when run by a non-root user, will silently fail the request to set SCHED_FIFO policy. The man page says it will fail with ENOTSUP. So this is a bug. If the requested functionality (RT behavior) is really not implemented at all, then you should not define _POSIX_THREAD_PRIORITY_SCHEDULING and should refuse the request with ENOSYS. |