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 04:00
Which of the following kinds of programs displays an online advertisement in a banner or pop-up window on webpages, email, or other internet service? e
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What can you prevent issues related to downloading content form the internet
Answers: 1
question
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
You know the right answer?
Considering the following algorithm, which of the following requirements are satisfied?
int c...
Questions
question
Mathematics, 20.02.2020 03:39
question
Mathematics, 20.02.2020 03:39
question
Mathematics, 20.02.2020 03:39
question
Mathematics, 20.02.2020 03:39
Questions on the website: 13722361