Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:30, officialrogerfp3gf2s
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, jayybrain6337
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
image
Computers and Technology, 24.06.2019 12:30, stephanieanaya7
Why does the pc send out a broadcast arp prior
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, brusawerin5969
Refer to the figure and match the theorem that supports the statement.1.if chords are =, then arcs are =.if bc = de, then arc bc = arc de2.if arcs are =, then chords are =.if arc bc = arc de, then bc = de3.diameters perpen
Answers: 3
Do you know the correct answer?
Considering the following algorithm, which of the following requirements are satisfied?
int c...

Questions in other subjects: