subject

A multithreaded web server wishes to keep track of the number of requests it services (known as hits.) Consider the following two strategies to prevent a race condition on the variable hits. The first strategy is to use a basic mutex lock when updating hits: int hits;
mutex lock hit lock;
hit lock. acquire();
hit lock. release();
A second strategy is to use an atomic integer:
atomic t hits;
atomic inc(&hits);
Explain which of these two strategies is more efficient.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 22:20
Learning sign language is an example of a(n) learning sign language is an example of a(n)
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
question
Computers and Technology, 24.06.2019 20:10
Approximately what portion of global employers tends to use social media websites to hire new employees?
Answers: 1
question
Computers and Technology, 24.06.2019 22:30
Distinguish between a skill resume and a chronological resume and explain when it is best to use each format
Answers: 1
You know the right answer?
A multithreaded web server wishes to keep track of the number of requests it services (known as hits...
Questions
question
English, 27.02.2021 18:20
Questions on the website: 13722360