[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#266507: NPTL (0.60) quirks with pthread_create (ignores attributes)



On Thu, 2004-08-19 at 05:32, Florian Schmidt wrote:
> On Thu, 19 Aug 2004 13:44:05 +0900
> GOTO Masanori <gotom@debian.or.jp> wrote:
> 
> > At Wed, 18 Aug 2004 04:51:59 +0200,
> > Florian Schmidt wrote:
> > > there's a problem with the libc6 package and a 2.6.x kernel. I have
> > > attached two test programs to illustrate the problem
> > > [test_thread_attr.cc and test_thread_post.cc; compile each with
> > > -lpthread].
> > > 
> > > The programs try to create a SCHED_FIFO thread. test_thread_attr
> > > tries this by setting the attributes before creating the thread.
> > > test_thread_post does this by using setschedparam explicitly after
> > > thread creation.
> > > 
> > > test_thread_attr fails silently. It reports no error ps -C
> > > test_thread_attr -cmL shows there are no SCHED_FIFO threads created:
> > 
> > AFAIK, one trial to fix this kind of problem is Robust Mutex.  They're
> > proposing kernel modification "fusyn", however I guess these
> > modifications will go into 2.7.
> 
> But basically the debian libc6 breaks pretty much all programs trying to
> change the scheduling policy of threads to RT [if they don't contain
> workarounds like in the test_thread_post example code].
> 

Agreed, talking about 2.7 (or even NPTL 0.61) is way overkill.  The fix
is trivial:

--- nptl/pthread_create.c~	2003-09-09 03:17:15.000000000 -0400
+++ nptl/pthread_create.c	2004-08-17 21:48:47.000000000 -0400
@@ -399,7 +399,7 @@
 
   /* Determine scheduling parameters for the thread.
      XXX How to determine whether scheduling handling is needed?  */
-  if (0 && attr != NULL)
+  if (attr != NULL)
     {
       if (iattr->flags & ATTR_FLAG_NOTINHERITSCHED)
 	{

Please apply. 

Lee






Reply to: