• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1NAME = "Priority inversion tests"
2AUTHOR = "Michal Piotrowski <michal.k.k.piotrowski@gmail.com>"
3TIME = "SHORT"
4TEST_CATEGORY = "FUNCTIONAL"
5TEST_CLASS = "KERNEL"
6TEST_TYPE = "CLIENT"
7DOC = """
8The basic premise here is to set up a deadlock scenario and confirm that PI
9mutexes resolve the situation. Three worker threads will be created from the
10main thread: low, medium and high priority threads that use SCHED_FIFO as
11their scheduling policy. The low priority thread claims a mutex and then
12starts "working". The medium priority thread starts and preempts the low
13priority thread. Then the high priority thread runs and attempts to claim
14the mutex owned by the low priority thread. Without priority inheritance,
15this will deadlock the program. With priority inheritance, the low priority
16thread receives a priority boost, finishes it's "work" and releases the mutex,
17which allows the high priority thread to run and finish and then the medium
18priority thread finishes.
19
20That's the theory, anyway...
21"""
22
23job.run_test('pi_tests')
24