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, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
question
Computers and Technology, 24.06.2019 22:30
What are the 4 basic items that are traded throughout the world?
Answers: 1
question
Computers and Technology, 25.06.2019 01:00
Why is outfitting a workplace with video games in a technology development company consiered a strategic use of money
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