Systems and low latency
Two threads each increment their own atomic counter, and throughput is far…
AdvancedMultiple choice
Two threads each increment their own atomic counter, and throughput is far worse than a single thread’s. What is the likeliest cause?
- ALock contention on the shared mutex protecting them
- BFalse sharing – the counters sit on one cache line
- CThe atomic operations are simply slow on this hardware
- DThe compiler has failed to inline the increment
The worked solution is in Premium
The answer, the full working and the one idea to take away – for this and all 1,322 questions in the bank. Answer it in practice and your working is marked, with a known mistake named when you make one.
Report an issue with this question
Learn the method
Latency, the memory hierarchy and why the tail is the number
Of the kind reported at
More systems and low latency questions
- An L1 cache reference costs about 1 ns and a main-memory reference about 100 ns.Foundation · Free solution
- Two systems: one has a mean of 2 μs and a p99.9 of 2 ms, the other a mean of 5…Applied · Free solution
- You collect one million latency samples.Applied · Premium
- A burst on the feed, part 3 of 4Advanced · Premium
- Your load generator sends the next request only after the previous response arrives.Expert · Premium
- You sort 1,000 latency samples in ascending order.Foundation · Premium