[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nptl] Re: NPTL issue with pthread_attr_setsched{param|policy}
Hi,
On Mon, 2004-10-18 at 21:42, Loic Domaigne wrote:
> I apologize if I report a known BUG to you. I remember seeing a related
> issue on the NPTL Forum, but I am not sure if it is exactly that one.
> (And, of course, I am too lazy to check it by myselves).
Huhu :) Well, the reported bug was actually that when the creation
failed with EPERM, when the user is not root, the thread executed for
some instructions before dying.
> I have just answered a question on c.p.t. that led me to write a small
> program which creates a thread in the SCHED_RR scheduling class at a
> given priority using thread's attribute.
>
> With LinuxThreads, it works as expected. If the process is not started
> as root, pthread_create() failed (due to wrong permission). If it is
> executed as root, the RT-thread preempts the SCHED_OTHER threads.
>
> However, with NPTL (v0.61) none of the two above cases behave as
> expected. When the process is not started as root, pthread_create()
> succeeds, but the RT-thread seems to run in the SCHED_OTHER class. This
> should failed. When the process is started as root, the RT-threads run,
> but apparently in the SCHED_OTHER class. This should run in the SCHED_RR
> class.
This is very strange. I've verified already that it works as expected
(and please consider the SCHED_RR sample we worked on some times ago, we
made use of those primitives as well). Are you sure you don't miss a
step? IIRC, pthread_attr_setinheritsched, pthread_attr_setschedparam and
pthread_attr_setschedpolicy are needed in order the change be
considered. I'm not sure what POSIX requires if for example the sched
policy was not specified, but (IIRC) the NPTL will ignore the request in
this case (this should be verified, actually).
> Do you have already tracked down that NPTL specific BUG already?
> Otherwise, I would be _really_ happy to devise a test.
Well, if it appears that this is a real bug, it would be great that you
write a testcase :)
Thank you,
Seb.
-------------------------------
Sebastien DECUGIS
NPTL Test & Trace Project
http://nptl.bullopensource.org/
"You may fail if you try.
You -will- fail if you don't."
Liste de diffusion nptl
Pour se désinscrire : mailto:nptl_request@bullopensource.org?subject=unsubscribe