[cgl_discussion] Question for TEMs/ISVs/OEMs regarding pthread requirements

Corey Minyard cminyard at mvista.com
Thu Jan 30 14:34:43 PST 2003


george anzinger wrote:

>"Perez-Gonzalez, Inaky" wrote:
>  
>
>>Finally somebody answers!!!! Thanks a lot, Pradeep
>>
>>    
>>
>>>>More specifically, I need to know what are the realtime
>>>>        
>>>>
>>>requirements of a
>>>      
>>>
>>>>pthreads package regarding mutex protocols. POSIX specifies
>>>>        
>>>>
>>>three priority
>>>      
>>>
>>>>protocols, PRIO_NONE, PRIO_PROTECT and PRIO_INHERIT. Does
>>>>        
>>>>
>>>anybody know or
>>>      
>>>
>>>>rely on the three of them and extensively require, for example,
>>>>PRIO_INHERIT?
>>>>        
>>>>
>>>Some of the applications that we are developing, rely on
>>>PRIO_INHERIT to
>>>avoid priority inversion problem.
>>>      
>>>
>>Well, the point I am trying to make here if is it is worth to implement
>>them, because they are a royal PITA; they create so many problems that just
>>thinking about it gives me headaches.
>>    
>>
>
>Buck up, Inaky, you just need a larger hat :)  
>
>If memory serves, there is a pthread package on sourceforge
>that supports userland PRIO_INHERIT.  I think it was done by
>Corey Minyard.  It should give you a leg up, so to speak. 
>Do I have this right Corey?
>
>-g
>  
>
You are correct, it's at http://ssthreads.sf.net, I developed it when I 
was at Nortel.  It will only work on PPC and IA32 right now.  It's the 
only Linux threads package I know of that supports priority inheritance. 
 I'm not sure that NPTL will support it, since it would require it to be 
put into the kernel. I'm guessing the NGPT will never be able to support 
it because they would need it in the kernel and need coordinated 
scheduler activations.  It's fairly complicated to implement correctly 
:-).  And it fundamentally affects a lot of things, so you can't just 
tack it on to an existing threads package.  When I looked at it, it was 
easier to implement an entire threads package from scratch than add it 
to LinuxThreads.

It also requires some kernel patches to work well.  It was designed to 
work on an unpatched kernel (it had to spawn an extra thread to do 
certain things) but the last time I tried it on an unpatched kernel it 
didn't work.  It also doesn't work between processes (the mutexes are 
only local scope).

-Corey

>  
>





More information about the cgl_discussion mailing list