Bug 115045
Summary: | pthread_attr_setschedparam/policy does not work in NPTL | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | abhijeet bisain <abisain> |
Component: | glibc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED WORKSFORME | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 1 | CC: | drepper, pratik.solanki.ml |
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: | 2004-09-28 10:17:56 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: |
Description
abhijeet bisain
2004-02-05 20:57:49 UTC
Your test program is buggy. You rely on the setinheritsched flag to be PTHREAD_EXPLICIT_SCHED by default. This is not guaranteed, read the standard. It has been the case in LT, but it is not with NPTL. If you use a recent enough glibc and add a line like pthread_attr_setinheritsched(&spawner_attr, PTHREAD_EXPLICIT_SCHED); You'll get the result you want. Well in that case, at least the man page should change. "man pthread_attr_setinheritsched" says inheritsched ..... Default value: PTHREAD_EXPLICIT_SCHED. and "man 3p pthread_attr_setinheritsched" does not make any mention of what the default is. Also, can you point me to the part of the POSIX spec that says that the default should be PTHREAD_INHERIT_SCHED. I looked and it seemed to me that spec did not specify any default. If that is the case then why change the default in nptl? The manual page states it documents LinuxThreads. I add this line, pthread_attr_setinheritsched(&spawner_attr, PTHREAD_EXPLICIT_SCHED); but the created thread run with the policy SCHED_OTHER! I debug the program, it seems pthread_attr_setinheritsched does not work correct. Am I right? |