subject

4. A multithreaded web server wishes to keep track of the number of requests it services (known as hits). Consider the two following 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();
hits++;
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: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
List 3 items that were on kens resume that should have been excluded
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
You know the right answer?
4. A multithreaded web server wishes to keep track of the number of requests it services (known as...
Questions
question
Computers and Technology, 28.11.2019 12:31
question
History, 28.11.2019 12:31
question
Mathematics, 28.11.2019 12:31
Questions on the website: 13722361