PI Mutex Test

From RTwiki
(Difference between revisions)
Jump to: navigation, search
(External links)
(External links)
Line 10: Line 10:
 
This tarball contains the source code for two test programs:
 
This tarball contains the source code for two test programs:
  
classic_pi - a program that demonstrates how a PI mutex can resolve a Priority Inversion deadlock
+
* classic_pi - a program that demonstrates how a PI mutex can resolve a Priority Inversion deadlock
  
pi_stress - a stress test that runs groups of threads that cause Priority Inversions
+
* pi_stress - a stress test that runs groups of threads that cause Priority Inversions
  
You should be able to untar the archive into a directory and run 'make'. If your C library supports the Priority Inheritance attribute of pthread mutexes, the programs should build.
+
{{NOTE| This code has only been tested on Linux 2.6.17(and up) with the -rt patch and GLIBC 2.5+}}
 +
 
 +
To use, create a directory and untar the archive contents into that directory. Run make, which by default will build the two tests. If things don't compile, chances are your GLIBC does not support the Priority Inheritance attribute for pthread mutexes and you will need to upgrade.
 +
 
 +
Both programs have usage messaages (--help) that explain their options. The classic_pi program is generally just used to show that PI mutexes work, while the pi_stress program is used to exercies the PI code path.  
 +
 
 +
{{WARN|The pi_stress program uses many realtime (SCHED_FIFO or SCHED_RR) threads and can quickly render a machine unusable (i.e. press the big red button). '''Do Not Use it on a production machine!'''}}

Revision as of 20:46, 19 October 2006

This regression test suite was written by User:Clark to test the classic three-way Priority Inversion deadlock and shows that Priority Inheritance mutexes will avoid this deadlock.

TODO
Add documentation about using the test suite

External links

This tarball contains the source code for two test programs:

  • classic_pi - a program that demonstrates how a PI mutex can resolve a Priority Inversion deadlock
  • pi_stress - a stress test that runs groups of threads that cause Priority Inversions
NOTE!
This code has only been tested on Linux 2.6.17(and up) with the -rt patch and GLIBC 2.5+

To use, create a directory and untar the archive contents into that directory. Run make, which by default will build the two tests. If things don't compile, chances are your GLIBC does not support the Priority Inheritance attribute for pthread mutexes and you will need to upgrade.

Both programs have usage messaages (--help) that explain their options. The classic_pi program is generally just used to show that PI mutexes work, while the pi_stress program is used to exercies the PI code path.

ATTENTION!
The pi_stress program uses many realtime (SCHED_FIFO or SCHED_RR) threads and can quickly render a machine unusable (i.e. press the big red button). Do Not Use it on a production machine!
Personal tools