what is "priority inversion/priority inheritance" ?

what is "priority inversion/priority inheritance" ?

Post by somez7 » Wed, 27 Feb 2002 00:44:59



Hi, all
    I'd like to know what is "priority inversion/priority inheritance" in
linux programming.?
    could someone explain me about  "priority inversion/priority
inheritance".?
    at what situation do we need to use priority inversion/priority
inheritance?
    I read book, but I have diffcult understanding "priority
inversion/priority inheritance".

thank you in advance.
have a day.

 
 
 

what is "priority inversion/priority inheritance" ?

Post by Kaz Kylhe » Tue, 26 Feb 2002 09:11:26



>Hi, all
>    I'd like to know what is "priority inversion/priority inheritance" in
>linux programming.?

Priority inversion is a problem in real-time programming. The priority
inheritance protocol is one solution to it. We don't currently have that
solution in the Linux implementation of POSIX threads.

Priority inversion is a situation in which a high priority thread is starved
of CPU time, while some lower priority thread is able to execute. One
way in which it can happen is that the high priority thread blocks on
acquiring exclusive ownership of some object that is held by a low
priority thread. The low priority thread cannot release the object because
some intermediate priority thread is executing. So long as that intermediate
thread is ready to execute, the low priority thread gets no cycles, and
so it won't releease the resource to allow the high priority thread to run.

There are two main solutions: priority ceiling and priority inheritance
protocol. Priority ceiling means that the exclusive object, such as a mutex,
is given some priority value. Any thread which acquires that object is
raised to that priority, if its priority is lower. This solution is easy
to implement, but it leaves it up to the programmer to assign priority
values to objects. Unless the programmer can prove otherwise, the only
good priority to assign to an object is the maximum possible priority.
Moreover, as a complex program is maintained, the assignments of priority
may become incorrect.

Priority inheritance protocol is more complex; it involves dynamically
changing a thread's priority. The idea is that if a thread is about
to block on acquiring the object, and the thrad which currently owns
that object has a lower priority than this thread, that owning thread's
priority is boosted to be equal to the waiter's priority. When the
object is released, the priority of the thread must be restored to its
original one. This is a nice solution in that it allows the programmer
to be unconcerned with priority inversion. But it's harder to implement
than priority ceiling.

--
Meta-CVS: version control with directory structure versioning over top of CVS.
http://users.footprints.net/~kaz/mcvs.html

 
 
 

1. "syslogd: unknown priority "24" " error - won't boot!

I have upgraded from 1.2.13  to 2.0 & was in the process of upgrading the
associated files.  Last nite I upgraded to util-linux-2.5.tar.gz, & when I
rebooted I got a "syslogd:  unknown priority "24"" error and my system hung.
My only edits to MCONFIG were setting HAVE_SVSVINIT & HAVE_SVIVINIT_UTILS
to yes, my intent was to next update these using sysvinit-2.6.2.tar.gz.
The compilation of util-linux-2.5 went OK unitl an error on cal.c for not
having /usr/include/localeinfo.h.  I looked at the Makefile for the section
with cal.c & saw that cal was the only thing which complained about this so I
removed cal from the Makefile in the misc-utils directory.  The make then
worked fine (just using "make").  I then did "make install" & rebooted & got

        .
        .      
        .
        Starting daemons: cron lpd
        fcntl_setlk() called by process41(cron) with broken flock() emulation
        /bin/hostname Permission denied
        syslogd:  unknown priority "24" " error

Now the system will not boot!

Is there something obvious that I did wrong?  My (uneducated) guess is that
should have updated the sysvinit-2.6.2 stuff BEFORE rebooting. I had  
previously never upgraded either the linux-utils or the sysvinit stuff
since I did my initial install from the Yggdrasil Fall 94 distr.

The obvious question now is how do I fix this?

How I got there:


http://www.signet.com.sg/~sunsurf & installed the following packages in this
order (I already had gcc 2.7.2):

make-3.74-bin-elf
binutils-2.6.0.14
ld.so-1.7.14
libg++-2.7.1.4
ppp-2.2.0f
2.0 kernel compilation
libc-5.3.12
procps-0.99a

I rebooted & everything worked fine.  I then began updating the other
suggested packages:

termcap-2.0.8
procinfo-? (oops, don't remember this vesion)
utils-2.5

I rebooted & this is where the show-stopping syslogd error occurred.

Any suggestions are much appreciated!

        Terry

2. md5 for NCR MP-RAS

3. == lower the priority of commands such as "cp" or "mv" ==

4. Mandrake Install Help Needed

5. GETSERVBYNAME()????????????????????"""""""""""""

6. micq link dead from ports?

7. any documents on "priority STREAMS" of solaris 8 or higher?

8. X reference stuff

9. any documents on "priority STREAMS" ?

10. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

11. priority inversion

12. Solaris 8, Priority Inversion, and RT Scheduling

13. pthreads and priority inversion