subject

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: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
The method of presentation refers to the planning process for the presentation. the information chosen for the presentation. how the presentation topic will be introduced. how the presentation will be delivered.
Answers: 1
question
Computers and Technology, 22.06.2019 12:30
Which of the choices sean are not true when considering virus behavior
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
You know the right answer?
A multithreaded web server wishes to keep track of the number of requests it services (known as hit...
Questions
question
Chemistry, 09.11.2020 14:00
question
English, 09.11.2020 14:00
question
Physics, 09.11.2020 14:00
question
Mathematics, 09.11.2020 14:00
question
Social Studies, 09.11.2020 14:00