Priority Ceiling Protocol :- Basics and Essentials
"Bird's-eye view", A series of short reads on various topics to refresh some fundamental concepts. In this article we will discuss about basics and essentials of Priority Ceiling Protocol [PCP].
The Priority Ceiling Protocol (PCP) was introduced to prevent deadlocks and to minimise the priority inversion problem. This protocol is designed in a way to not allow a task instance to run its critical section if there are already locked semaphores that could block the instance. So a Low Priority (LP) task cannot block a High Priority (HP) task until its completion, if the HP task has already entered its critical section.
PCP essentials:- Design Overview
1. PCP restrictions on semaphore usage
- Task instances should only lock semaphores in a "pyramid" fashion.
- Holding semaphores between task instances are not allowed.
2. PCP representation
3. PCP working structure
If a task want to lock a semaphore, then the priority of the task should be higher than the ceiling of all semaphores currently locked by all other tasks. if not, the task will be blocked.
4. Response Time Analysis (RTA) calculation
The RTA with blocking can be calculated with the following equation. Iterative method can be used to solve the same.