Operating Systems MCQs with explanation

A scenario in priority based scheduling where higher priority tasks wait for a low priority task to complete, when both of them share the same resources is called

  1. Priority ceiling
  2. Priority sharing
  3. Priority Inheritance 
  4. Priority Inversion 



Answer:
Option d: Priority Inversion


In priority based scheduling, Priority Inversion refers to a scenario where a higher priority task holding a shared resource. 

Priority inversion occurs when a low-priority task holds a resource that is needed by a high-priority task. This prevents the high-priority task from running, even though it has a higher priority.

There are a number of ways to prevent priority inversion. They are
  • Priority ceiling
  • Priority Sharing 
  • Priority Inheritance 

What is Priority Ceiling?

Priority ceiling is a synchronization mechanism used to prevent priority inversions by assigning a priority to shared resourses.

What is Priority Sharing?

Is the concept where multiple tasks with the same priority share resources without causing priority inversions. 

What is Priority Inheritance?
Priority Inheritance prevent priority inversion and ensures that higher priority tasks are not delayed unnecessarily.
How it works?Priority inheritance works by temporarily increasing the priority of the lower-priority task that is holding the resource. By this that low priority process can access all resources need for it and completes its job. (and now Higher priority job can ger run time). This ensures that the higher-priority task is not blocked, and can continue to run as soon as the lower-priority task releases the resource.

Feel free to ask your doubts in the comment section. 😊



Post a Comment

0 Comments