24 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| NAME = "Priority inversion tests"
 | |
| AUTHOR = "Michal Piotrowski <michal.k.k.piotrowski@gmail.com>"
 | |
| TIME = "SHORT"
 | |
| TEST_CATEGORY = "FUNCTIONAL"
 | |
| TEST_CLASS = "KERNEL"
 | |
| TEST_TYPE = "CLIENT"
 | |
| DOC = """
 | |
| The basic premise here is to set up a deadlock scenario and confirm that PI
 | |
| mutexes resolve the situation. Three worker threads will be created from the
 | |
| main thread: low, medium and high priority threads that use SCHED_FIFO as
 | |
| their scheduling policy. The low priority thread claims a mutex and then
 | |
| starts "working". The medium priority thread starts and preempts the low
 | |
| priority thread. Then the high priority thread runs and attempts to claim
 | |
| the mutex owned by the low priority thread. Without priority inheritance,
 | |
| this will deadlock the program. With priority inheritance, the low priority
 | |
| thread receives a priority boost, finishes it's "work" and releases the mutex,
 | |
| which allows the high priority thread to run and finish and then the medium
 | |
| priority thread finishes.
 | |
| 
 | |
| That's the theory, anyway...
 | |
| """
 | |
| 
 | |
| job.run_test('pi_tests')
 |