qqz.sty: Add page number to the QQZ heading for 'nq' build
PATCH 1/2 qqz.sty: Add page number to the QQZ heading for 'nq' build
From 7b56ddf382f836201b9e88e2f7b185fae422314e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Fri, 31 Jul 2020 00:18:58 +0900
Subject: [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build
Excerpt of Paul's message:
For a printed book, would it make sense to put the page number of the quick-quiz source (the location of the little box containing "QQ" and the quick-quiz number) into each answer? Or after each question?
This commit adds the page number at the right-hand side of quiz heading in framed box. It is also a hyperlink to the little box in the text.
--- qqz.sty | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
qqz.sty +3 -1
@@ -59,6 +59,8 @@ \newcommand{\QuickQuizAnswerChapter}{\textbf{Unknown QuickQAC!!!}} \newcommand{\QuickQHeading}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}} +\newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}% + \hfill\raisebox{0.5ex}{\footnotesize\fbox{p.\pageref{#2.#3}}}} \newcommand{\QuickQHeadingLight}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3}} \newcommand{\QuickQHeadingBegin}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3},} \newcommand{\QuickQHeadingMiddle}[3]{\scriptsize\hyperref[#2.#3]{{ #3}}\label{#1.#3},}
@@ -219,7 +221,7 @@ \newcommand{\QuickQ}[1]{ \begin{tcolorbox}[breakable] \refstepcounter{quickquizctrC} - \QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} \\ + \QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC}\\ } \newcommand{\QuickA}[1]{%
Signature · 1 line
2.17.1
PATCH 2/2 toyrcu: Minor fixes
From da7b054019f8377b87a050a8b2544f2e5ace607d Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Fri, 31 Jul 2020 00:28:42 +0900
Subject: [PATCH 2/2] toyrcu: Minor fixes
The floating snippet at the beginning of QQZ answer caused small skip at the start of the answer part.
It might also cause an orphaned "Answer" heading.
Fix this by moving the snippet a few sentences down.
Note: I made a paragraph break in the middle of the long paragraph.
The other change is to use \O{} macro in the same way as the other places.
I missed this one in commit 5e9a9c723a0b ("toyrcu: Use mathcal O for 'orders of'")
--- appendix/toyrcu/toyrcu.tex | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
appendix/toyrcu/toyrcu.tex +11 -9
@@ -78,7 +78,15 @@ preventing grace-period sharing. \cref{lst:app:toyrcu:Lock-Based RCU Implementation} also be a deadlock in any other RCU implementation? }\QuickQuizAnswerB{ -% + \begin{fcvref}[ln:app:toyrcu:Deadlock in Lock-Based RCU Implementation] + Suppose the functions \co{foo()} and \co{bar()} in + \cref{lst:app:toyrcu:Deadlock in Lock-Based RCU Implementation} + are invoked concurrently from different CPUs. + Then \co{foo()} will acquire \co{my_lock()} on \clnref{foo:acq}, + while \co{bar()} will acquire \co{rcu_gp_lock} on + \clnref{bar:rrl}. + \end{fcvref} + \begin{listing}[tbp] \begin{fcvlabel}[ln:app:toyrcu:Deadlock in Lock-Based RCU Implementation] \begin{VerbatimL}[commandchars=\\\[\]]
@@ -106,14 +114,8 @@ void bar(void) \caption{Deadlock in Lock-Based RCU Implementation} \label{lst:app:toyrcu:Deadlock in Lock-Based RCU Implementation} \end{listing} -% + \begin{fcvref}[ln:app:toyrcu:Deadlock in Lock-Based RCU Implementation] - Suppose the functions \co{foo()} and \co{bar()} in - \cref{lst:app:toyrcu:Deadlock in Lock-Based RCU Implementation} - are invoked concurrently from different CPUs. - Then \co{foo()} will acquire \co{my_lock()} on \clnref{foo:acq}, - while \co{bar()} will acquire \co{rcu_gp_lock} on - \clnref{bar:rrl}. When \co{foo()} advances to \clnref{foo:rrl}, it will attempt to acquire \co{rcu_gp_lock}, which is held by \co{bar()}. Then when \co{bar()} advances to \clnref{bar:acq}, it will attempt
@@ -930,7 +932,7 @@ RCU implementation being used in production in real-life applications. overhead that increases linearly with the number of threads. Under what circumstances could an RCU implementation enjoy lightweight implementations for all three of these primitives, - all having deterministic ($O\left(1\right)$) overheads and latencies? + all having deterministic ($\O{1}$) overheads and latencies? }\QuickQuizAnswer{ Special-purpose uniprocessor implementations of RCU can attain this ideal~\cite{PaulEMcKenney2009BloatwatchRCU}.
Signature · 1 line
2.17.1
Quoted 5 lines · Akira Yokosawa
Quoted 1 line
From
7b56ddf382f836201b9e88e2f7b185fae422314eMon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Fri, 31 Jul 2020 00:18:58 +0900
Subject: [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build
Quoted 8 lines
Excerpt of Paul's message:
For a printed book, would it make sense to put the page number of the quick-quiz source (the location of the little box containing "QQ" and the quick-quiz number) into each answer? Or after each question?
This commit adds the page number at the right-hand side of quiz heading in framed box. It is also a hyperlink to the little box in the text.
Looks great, thank you!!! Queued and pushed.
Thanx, Paul
Quoted 31 lines
Suggested-by Paul E. McKenney <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- qqz.sty | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)qqz.sty +3
-1@@ -59,6 +59,8 @@ \newcommand{\QuickQuizAnswerChapter}{\textbf{Unknown QuickQAC!!!}} \newcommand{\QuickQHeading}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}} +\newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}% + \hfill\raisebox{0.5ex}{\footnotesize\fbox{p.\pageref{#2.#3}}}} \newcommand{\QuickQHeadingLight}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3}} \newcommand{\QuickQHeadingBegin}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3},} \newcommand{\QuickQHeadingMiddle}[3]{\scriptsize\hyperref[#2.#3]{{ #3}}\label{#1.#3},}@@ -219,7 +221,7 @@ \newcommand{\QuickQ}[1]{ \begin{tcolorbox}[breakable] \refstepcounter{quickquizctrC} - \QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} \\ + \QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC}\\ } \newcommand{\QuickA}[1]{%Signature · 1 line
2.17.1