Skip to contentSkip to conversation

Update Answer to Quick Quiz 5.27

PATCH In review Junchang Wang 3 participants 7 messages May 9, 2017 – May 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update Answer to Quick Quiz 5.27

Oops. Forgot the summary in previous email. Resend the patch.

The Answer to Quick Quiz 5.27 is a bit hard to follow. Rewrite it.

---
 count/count.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
count/count.tex +7 -7
index cc47554..6dfc7a6 100644
@@ -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
#1 lore raw
Quoted 26 lines · Junchang Wang

Oops. Forgot the summary in previous email. Resend the patch.

The Answer to Quick Quiz 5.27 is a bit hard to follow. Rewrite it.

---
 count/count.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
count/count.tex +0 -7
index cc47554..6dfc7a6 100644
@@ -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.

count/count.tex machine. · line 1270

Quoted 10 lines
count/count.tex +7 -0
+	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.

Hi Junchang,

What confused you seems to be a simple typo.
Isn't the following one-liner sufficient for you?

Thanks, Akira

--8<---->8--
From 725b32938e0cbc245e5a528fd475951bb8be1de5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 9 May 2017 23:39:57 +0900
Subject: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

---
 count/count.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
count/count.tex +1 -1
index cc47554..096b53d 100644
@@ -1260,7 +1260,7 @@ machine.
 \QuickQuizAnswer{
 	One approach would be to maintain a global approximation
 	to the value.
-	Readers would increment their per-thread variable, but when it
+	Updaters 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
Signature · 1 line
2.7.4
#2 lore raw

Hi Akira,

That's the major point. Fair enough :-)

Thanks,
--Jason

Quoted 74 lines · Akira Yokosawa
Quoted 26 lines · Junchang Wang

Oops. Forgot the summary in previous email. Resend the patch.

The Answer to Quick Quiz 5.27 is a bit hard to follow. Rewrite it.

---
 count/count.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
count/count.tex +0 -7
index cc47554..6dfc7a6 100644
@@ -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.

count/count.tex machine. · line 1270

Quoted 10 lines
count/count.tex +7 -0
+     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.

Hi Junchang,

What confused you seems to be a simple typo.
Isn't the following one-liner sufficient for you?

Thanks, Akira

--8<---->8--
From 725b32938e0cbc245e5a528fd475951bb8be1de5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 9 May 2017 23:39:57 +0900
Subject: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

---
 count/count.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
count/count.tex +1 -2
index cc47554..096b53d 100644
@@ -1260,7 +1260,7 @@ machine.
 \QuickQuizAnswer{
        One approach would be to maintain a global approximation
        to the value.
-       Readers would increment their per-thread variable, but when it
+       Updaters 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
--

2.7.4

#3 lore raw
Quoted 4 lines · Junchang Wang

Hi Akira,

That's the major point. Fair enough :-)

So, are you OK with me submitting the patch with your Acked-by?

Thanks, Akira

Quoted 81 lines

Thanks,
--Jason

Quoted 74 lines · Akira Yokosawa
Quoted 26 lines · Junchang Wang

Oops. Forgot the summary in previous email. Resend the patch.

The Answer to Quick Quiz 5.27 is a bit hard to follow. Rewrite it.

---
 count/count.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
count/count.tex +0 -7
index cc47554..6dfc7a6 100644
@@ -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.

count/count.tex machine. · line 1270

Quoted 10 lines
count/count.tex +7 -0
+     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.

Hi Junchang,

What confused you seems to be a simple typo.
Isn't the following one-liner sufficient for you?

Thanks, Akira

--8<---->8--
From 725b32938e0cbc245e5a528fd475951bb8be1de5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 9 May 2017 23:39:57 +0900
Subject: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

---
 count/count.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
count/count.tex +1 -2
index cc47554..096b53d 100644
@@ -1260,7 +1260,7 @@ machine.
 \QuickQuizAnswer{
        One approach would be to maintain a global approximation
        to the value.
-       Readers would increment their per-thread variable, but when it
+       Updaters 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
--

2.7.4

#4 lore raw

Hi Akira,

Sure. Please go ahead. Thanks a lot.

--Jason

Quoted 91 lines · Akira Yokosawa
Quoted 4 lines · Junchang Wang

Hi Akira,

That's the major point. Fair enough :-)

So, are you OK with me submitting the patch with your Acked-by?

Thanks, Akira

Quoted 81 lines

Thanks,
--Jason

Quoted 74 lines · Akira Yokosawa
Quoted 26 lines · Junchang Wang

Oops. Forgot the summary in previous email. Resend the patch.

The Answer to Quick Quiz 5.27 is a bit hard to follow. Rewrite it.

---
 count/count.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
count/count.tex +0 -7
index cc47554..6dfc7a6 100644
@@ -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.

count/count.tex machine. · line 1270

Quoted 10 lines
count/count.tex +7 -0
+     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.

Hi Junchang,

What confused you seems to be a simple typo.
Isn't the following one-liner sufficient for you?

Thanks, Akira

--8<---->8--
From 725b32938e0cbc245e5a528fd475951bb8be1de5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 9 May 2017 23:39:57 +0900
Subject: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

---
 count/count.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
count/count.tex +1 -2
index cc47554..096b53d 100644
@@ -1260,7 +1260,7 @@ machine.
 \QuickQuizAnswer{
        One approach would be to maintain a global approximation
        to the value.
-       Readers would increment their per-thread variable, but when it
+       Updaters 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
--

2.7.4

#5 lore raw

PATCH 1/1 count: Fix typo in Answer to Quick Quiz 5.27

From 557aa593d97bf2b8cc47ff14fbcaf3f80703866a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 9 May 2017 23:39:57 +0900
Subject: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

---
 count/count.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
count/count.tex +1 -1
index cc47554..096b53d 100644
@@ -1260,7 +1260,7 @@ machine.
 \QuickQuizAnswer{
 	One approach would be to maintain a global approximation
 	to the value.
-	Readers would increment their per-thread variable, but when it
+	Updaters 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
Signature · 1 line
2.7.4
#6 lore raw

Re: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

Quoted 8 lines · Akira Yokosawa
Quoted 1 line

From 557aa593d97bf2b8cc47ff14fbcaf3f80703866a Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Tue, 9 May 2017 23:39:57 +0900
Subject: [PATCH] count: Fix typo in Answer to Quick Quiz 5.27

Queued and pushed, thank you both!

Thanx, Paul

Quoted 21 lines
---
 count/count.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
count/count.tex +1 -1
index cc47554..096b53d 100644
@@ -1260,7 +1260,7 @@ machine.
 \QuickQuizAnswer{
 	One approach would be to maintain a global approximation
 	to the value.
-	Readers would increment their per-thread variable, but when it
+	Updaters 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
Signature · 1 line
2.7.4