subject

Considering the following algorithm, which of the following requirements are satisfied?
int currentthread = 1;
bool thread1access = true;
bool thread2access = true;
thread1 { thread2 {
while (true) { while (true) {
while(thread2access == true) { while(thread1access == true) {
if (currentthread == 2) { if (currentthread == 1) {
thread1access = false; thread2access = false;
while (currentthread == 2); while (currentthread == 1);
thread1access = true; thread2access = true;
} }
/* start of critical section */ /* start of critical section */
currentthread = 2 currentthread = 1

/* end of critical section */ /* end of critical section */
thread1access = false; thread2access = false;

} }
} }
} }

a) mutual exclusion
b) bounded waiting
c) progress
d) none of the above

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
You know the right answer?
Considering the following algorithm, which of the following requirements are satisfied?
int c...
Questions
question
Mathematics, 04.07.2019 14:30
question
Social Studies, 04.07.2019 14:30
Questions on the website: 13722362