subject

Race conditions are possible in many computer systems. consider an online auction system where the current highest bid for each item must be maintained. a person who wishes to bid on an item calls the bid(amount) function, which compares the amount being bid to the current highest bid. if the amount exceeds the current highest bid, the highest bid is set to the new amount. this is illustrated below:

double amount = 0.0;

void bid(double amount) {

if (amount > highestbid)

highestbid = amount;

}

describe how a race condition is possible in this situation (you may describe it with some scenario)?

what might be done to prevent the race condition from occurring? (you may just modify the code using "acquire()" and "release()" statements)

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 19:30, 123iamthe1
You can apply several different worksheet themes from which tab?
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, petergriffin6772
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, danielweldon1234
When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being displayed?
Answers: 1
image
Computers and Technology, 25.06.2019 02:30, LilCookies1
Ahammer should not be applied to the gear shafts of an electric rotisserie because the shafts may be made of
Answers: 1
You know the right answer?
Race conditions are possible in many computer systems. consider an online auction system where the c...

Questions in other subjects:

Konu
Social Studies, 20.08.2019 18:00