1

Question I saw on site that explains the issue of mutual-exclusion (http://www.faculty.idc.ac.il/gadi/PPTs/Chapter2-Mutex-BasicTopics.pptx - page 8). Unfortunately there is no answer. Also, the original question is only about C but I didn't understand If the order is changing how it affects the result, so I added D.

Let A and B be two algorithms designed to solve the mutual-exclusion problem. In other words, their structure consists of an entry-section, critical-section and exit-section (but you cannot assume they satisfy mutual-exclusion or deadlock-freedom unless written otherwise). Assume that algorithms A and B do not use the same variables. We construct a new mutual-excusion algorithm, C, as follows:

Algorithm C

  • entry code of A
  • entry code of B
  • Critical Section
  • exit code of B
  • exit code of A

For each of the following assertions, please prove or disprove its correctness.

  1. If both A and B are deadlock-free, C is deadlock-free.
  2. If both A and B are starvation-free, C is starvation-free.
  3. If A or B satisfy mutual-exclusion, C satisfies mutual-exclusion.
  4. If A is deadlock-free and B is starvation-free, C is starvation-free.
  5. If A is starvation-free and B is deadlock-free, C is starvation-free.

Also that same questions, but this time on D instead of C, where D is:

Algorithm D

  • entry code of A
  • entry code of B
  • Critical Section
  • exit code of A
  • exit code of B

Thanks!

  • what does it means to be `designed to solve the mutual-exclusion problem` in the one hand and in the other hand I cannot assume they satisfy mutual-exclusion. Can we talk about A and B being a mutex or is a mutex used inside of A which is not used in B, and a mutex in B which is not used in A? – Aitch Mar 11 '15 at 01:25
  • According to what I understand the question, It's like what you wrote in the last option. One can be deadlock-free and the another may not. Also, One can be starvation-free and the another may not. – stackoverflow Mar 11 '15 at 01:44
  • I can't answer it, but the slides are using the http://en.wikipedia.org/wiki/Dekker%27s_algorithm which is deadlock-free and starvation-free. Maybe you can find your answer there. – Aitch Mar 11 '15 at 08:50

0 Answers0