3

I'm studying scheduling and in particular the real time scheduling implemented in C. Now i'm stuck with a question about nested critical sections. The slides i'm studying use the assumption that if a task use a nested critical section, it always release first the inner resourse and then the second. Like pictured in this image:

enter image description here

But, i dont know the meaning of this assumption, why it is important. Can you help me ?

Community
  • 1
  • 1
Qwerto
  • 265
  • 2
  • 10
  • 1
    I would see this as the definition of "nested" - one is inside the other. If the regions are just partially overlapping, they are not nested. – Bo Persson Jun 06 '18 at 06:16
  • Maybe i didn't use accurate words, but i think the problem is clear – Qwerto Jun 06 '18 at 06:54
  • What do you mean by "the meaning of this assumption" and "why it is important"? What you are showing us is just the definition of "nested". The slides just explain what it is. – Max Vollmer Jun 06 '18 at 08:23
  • 1
    It is a good practice to release locks in the `innermost to outermost` order. It avoids corrupt resources, deadlocks in cases like re-entrant locks and easier to debug. – Ketan Mukadam Jun 06 '18 at 08:50
  • Thanks. I dont understand what you mean for "It avoids corrupt resources", and which case of deadlock it prevents – Qwerto Jun 06 '18 at 15:02

0 Answers0