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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 20:00
Match the file formats with the types of multimedia they can store
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
What are some settings you can control when formatting columns?
Answers: 1
question
Computers and Technology, 23.06.2019 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
You know the right answer?
Race conditions are possible in many computer systems. consider an online auction system where the c...
Questions
question
Mathematics, 10.02.2021 02:00
question
Mathematics, 10.02.2021 02:00
question
English, 10.02.2021 02:00
question
Mathematics, 10.02.2021 02:10