1) The man pages for pthread_create() say that if you don't specify "attr", then the default scheduler class is used. The man page for pthread_attr_init() specifies that the default sched policy is SCHED_OTHER. However, if you put the original thread into the SCHED_RR class and give it a nonzero priority, then call pthread_create() with "attr" of NULL, the new thread will end up with the same scheduler parameters as the thread that created it. This violates the stated semantics. 2) The default attribute for the "inheritsched" attribute is supposed to be that you do not inherit the scheduler parameters. This would seem to imply that ATTR_FLAG_NOTINHERITSCHED should be *set* by default. However, based on the code pthread_attr_init() simply sets everything to zero, then sets the guardsize member. This means that for me to specify scheduler attributes I have to explicitly call pthread_attr_setinheritsched() with PTHREAD_EXPLICIT_SCHED even though it's supposed to be the default.
I'm takin a look at this.
Created attachment 748 [details] testcase for bug This testcase should be run as root, and will verify the behaviour listed in the bug.
You shouldn't be looking into LinuxThreads manual pages when you are running NPTL. Use POSIX manual pages or standard instead.
The bug was tested on ppc64 kernel, with ppc userpace, and on i386. It has been verified to exist on the following distros: Yellowdog 4 with libc 2.3.3 Windriver distro with libc 2.3.4 Mandrake 10.0 with libc 2.3.3
(In reply to comment #3) > You shouldn't be looking into LinuxThreads manual pages when you are running > NPTL. Use POSIX manual pages or standard instead. Chris, can you confirm whether you are using LinuxThreads or NPTL? The bug is filed against LinuxThreads but at least two of the distributions you've listed use NPTL by default.
(In reply to comment #3) > You shouldn't be looking into LinuxThreads manual pages when you are running > NPTL. Use POSIX manual pages or standard instead. Crap. Apparently two separate distros used NPTL but kept the older man pages. The very latest man pages do not actually specify a default value for any of the three attributes involved (inheritsched, policy, or priority). I guess there isn't an issue with libc, rather with the distros in question.
Sorry, I was using NPTL...guess I didn't notice the distinction. Looks like it was a distro issue rather than a libc one.
I'm marking this INVALID because of the comments above and because I did not see anything in the Open Group spec that contradicted the current behavior. As mentioned above this appears to be a distro specific issue with the documentation.