Update Answer to Quick Quiz 5.27
PATCH 1/1 Update Answer to Quick Quiz 5.27
Signed-off-by Junchang Wang <[email protected]>
--- count/count.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
count/count.tex +7 -7
@@ -1258,13 +1258,13 @@ machine. fast and scalable while allowing readers to also enjoy reasonable performance and scalability? \QuickQuizAnswer{ - One approach would be to maintain a global approximation - to the value. - Readers would increment their per-thread variable, but when it - reached some predefined limit, atomically add it to a global - variable, then zero their per-thread variable. - This would permit a tradeoff between average increment overhead - and accuracy of the value read out. + One approach would be to add a global variable maintaining a + approximation to the exact value. An updater would increment its + per-thread variable, and when its value reaches predefined limit, + atomically add the value to the global variable, then zero its + per-thread variable. Readers simply return the value of global variable, + enjoying reasonable performance. This would permit a tradeoff between + average increment overhead and accuracy of the value read out. The reader is encouraged to think up and try out other approaches, for example, using a combining tree.
Signature · 1 line
2.7.4