[PATCH] Update Answer to Quick Quiz 5.27

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Junchang Wang <junchangwang@xxxxxxxxx>
---
 count/count.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/count/count.tex b/count/count.tex
index cc47554..6dfc7a6 100644
--- a/count/count.tex
+++ b/count/count.tex
@@ -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.
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux