subject
Engineering, 04.03.2020 04:02 foxesrcool11

A software approach to mutual exclusion is Lamport’s bakery algorithm [LAMP74], so called because it is based on the practice in bakeries and other shops in which every customer receives a numbered ticket on arrival, allowing each to be served in turn. The algorithm is as follows:
boolean choosing[n];
int number[n];
while (true) {
choosing[i] = true;
number[i] = 1 + getmax(number[], n);
choosing[i] = false;
for (int j = 0; j < n; j++){
while (choosing[j]) { };
while ((number[j] != 0) && (number[j],j) < (number[i],i)) { };
}
/* critical section */;
number [i] = 0;
/* remainder */;
}
The arrays choosing and number are initialized to false and 0, respectively. The ith element of each array may be read and written by process i but only read by other processes. The notation (a, b) < (c, d) is defined as:
(a < c) or (a = c and b < d)
a. Describe the algorithm in words.
b. Show that this algorithm avoids deadlock.
c. Show that it enforces mutual exclusion.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Ahouse has the following electrical appliance usage (1) single 40w lamp used for 4 hours per day (2) single 60w fan used for 12 hours per day (3) single 200w refrigerator that runs 24 hours per day with compressor run 12 hours and off 12 hours find the solar power inverter size in watt with correction factor of 1.25.
Answers: 1
question
Engineering, 04.07.2019 18:10
Acompressor receives the shaft work to decrease the pressure of the fluid. a)- true b)- false
Answers: 3
question
Engineering, 04.07.2019 18:20
An engine runs on the ideal diesel cycle. the cycle has a compression ratio of 20 and a cutoff ratio of 2. the highest temperature in the cycle is 1200 k. if the heat into the system is 300 kj/kg of working fluid and using variable specific heats determine the work produced per mass of working fluid
Answers: 3
question
Engineering, 04.07.2019 18:20
A3-mm-thick panel of aluminum alloy (k 177 w/m-k, c 875 j/kg-k and ? = 2770 kg/m) is finished on both sides with an epoxy coating that must be cured at or above t,-150°c for at least 5 min. the production line for the curing operation involves two steps: (1) heating in a large oven with air at ts,0-175°c and a convection coefficient of h, 40 w/m2. k, and (2) cooling in a large chamber with air at 25°c and a con- vection coefficient of he 10 w/m2.k. the heating portion of the process is conducted over a time interval te which exceeds the ime required to reach 150°c by 5 min (h = r + 300 s). the coating has an emissivity of ? = 0.8, and the temperatures of the oven and chamber walls are 175 and 25°c, respectively. if the panel is placed in the oven at an initial temperature of 25°c and removed from the chamber at a safe-to-touch tempera ture of 37°c, what is the total elapsed time for the two-step curing operation?
Answers: 3
You know the right answer?
A software approach to mutual exclusion is Lamport’s bakery algorithm [LAMP74], so called because it...
Questions
question
Mathematics, 16.08.2021 19:50
question
Mathematics, 16.08.2021 19:50
question
Chemistry, 16.08.2021 19:50
question
Mathematics, 16.08.2021 19:50
question
German, 16.08.2021 19:50
Questions on the website: 13722360