Priority Ceiling Protocol

Priority Ceiling Protocol

Priority Ceiling Protocol is an advanced task scheduling algorithm, principles of which were presented in the context of the Wireless Embedded Systems MSc.


Konstantinos Goutsos

April 23, 2015


  1. Priority Ceiling Protocol Konstantinos Goutsos EEE8068: Real-Time Computer Systems School

    of Electrical and Electronic Engineering Newcastle University 1 April 2015
  2. Presentation Outline •Introduction • Resources: Shared and Exclusive • Semaphores

    and Critical Sections • Task blocking and Deadlocks •Priority Inversion Phenomenon •Priority Inheritance Protocol •Priority Ceiling Protocol • Justification • Definition • Example 2 April 2015
  3. Resources • Software structures used by processes • Shared resources:

    can be used by multiple processes • Exclusive resources: protected against simultaneous use by more than one process using critical sections 3 April 2015
  4. Critical Sections • Task sections which should not be interrupted

    • Used to control access to exclusive resources • Usually implemented with semaphores • Semaphores: provided by the OS, bound to an exclusive resource • Semaphores can be used only by the wait and signal primitives 4 April 2015
  5. Task blocking and Deadlocks • A task can stay in

    a waiting state: task blocking • The maximum blocking time is very important for real- time systems • Deadlock: a situation where two or more tasks are waiting for each other to complete 5 April 2015
  6. Priority Inversion Phenomenon • Appears when using preemption and critical

    sections • A high priority task has to wait for a lower priority one to exit a critical section in order to enter its own • Happens when a low priority task has entered its critical section first • May create unbounded blocking as the waiting time depends on the execution time of lower priority tasks 6 April 2015
  7. Priority Inversion Phenomenon: Example 7 April 2015 [Buttazzo 2011]

  8. Priority Inversion Phenomenon: Example 8 April 2015 [Buttazzo 2011] 1

    > 2 > 3
  9. Dealing with the Phenomenon • Simple solution: Disable preemption during

    critical sections • Complex priority protocols • Static priorities: Priority Inheritance, Priority Ceiling • Static & dynamic priorities: Stack Resource Policy 9 April 2015
  10. Priority Inheritance Protocol • A task causing blocking temporarily assumes

    the priority of the blocked task • Plus: Bounds the maximum blocking time (which can be calculated) • Minus: Blocking time is not reduced and deadlocks are not prevented 10 April 2015
  11. Priority Ceiling Protocol • Builds on the Priority Inheritance Protocol

    • Adds a rule for granting lock requests on semaphores: Each semaphore is assigned a priority ceiling • The ceiling is equal to the priority of the highest priority job that can lock the semaphore • A task can only lock a semaphore if its priority is higher than the larger priority ceiling among all locked semaphores • Makes sure that once a job enters a critical section it cannot be blocked by lower priority jobs 11 April 2015
  12. Priority Ceiling Protocol: Example 12 April 2015 [Buttazzo 2011] 1

    > 2 > 3
  13. References G. C. Buttazzo, Hard Real-time Computing Systems: Predictable Scheduling

    Algorithms and Applications. 2011. April 2015 13