* [PATCH 1/5] Trial use of extdash package with shortcuts option
2016-08-08 15:00 [PATCH 0/5] Several cosmetic fixes Akira Yokosawa
@ 2016-08-08 15:02 ` Akira Yokosawa
2016-08-08 15:03 ` [PATCH 2/5] formal/ppcmem: Avoid break-line after 'lines' in source Akira Yokosawa
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-08 15:02 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From 554632b41d91d5c8aa8eb217d2709d9cf0e56a02 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 6 Aug 2016 23:29:46 +0900
Subject: [PATCH 1/5] Trial use of extdash package with shortcuts option
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
count/count.tex | 4 ++--
howto/howto.tex | 2 +-
intro/intro.tex | 6 +++---
perfbook.tex | 1 +
toolsoftrade/toolsoftrade.tex | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/count/count.tex b/count/count.tex
index dbb3530..29ad3fb 100644
--- a/count/count.tex
+++ b/count/count.tex
@@ -895,7 +895,7 @@ comes at the cost of the additional thread running \co{eventual()}.
} \QuickQuizEnd
\QuickQuiz{}
- Given that in the eventually-consistent algorithm shown in
+ Given that in the eventually\-/consistent algorithm shown in
Figure~\ref{fig:count:Array-Based Per-Thread Eventually Consistent Counters}
both reads and updates have extremely low overhead
and are extremely scalable, why would anyone bother with the
@@ -904,7 +904,7 @@ comes at the cost of the additional thread running \co{eventual()}.
given its costly read-side code?
\QuickQuizAnswer{
The thread executing \co{eventual()} consumes CPU time.
- As more of these eventually-consistent counters are added,
+ As more of these eventually\-/consistent counters are added,
the resulting \co{eventual()} threads will eventually
consume all available CPUs.
This implementation therefore suffers a different sort of
diff --git a/howto/howto.tex b/howto/howto.tex
index 63ca842..753a89f 100644
--- a/howto/howto.tex
+++ b/howto/howto.tex
@@ -270,7 +270,7 @@ Fortunately, there are many alternatives available to you:
the first formally published academic textbook to include a
section devoted to RCU.
\item If you would like an academic treatment of parallel
- programming from a programming-language-pragmatics viewpoint,
+ programming from a programming\-/language\-/pragmatics viewpoint,
you might be interested in the concurrency chapter from Scott's
textbook~\cite{MichaelScott2006Textbook}
on programming-language pragmatics.
diff --git a/intro/intro.tex b/intro/intro.tex
index 4527f19..e54e5ad 100644
--- a/intro/intro.tex
+++ b/intro/intro.tex
@@ -108,7 +108,7 @@ and message-passing systems~\cite{OpenMPI2008,BOINC2008}.
This book will draw primarily from the Linux kernel, but will
provide much material suitable for user-level applications.
-Fourth, even though the large-scale parallel-programming projects of
+Fourth, even though the large-scale parallel\-/programming projects of
the 1980s and 1990s were almost all proprietary projects, these
projects have seeded other communities with a cadre of developers who
understand the engineering discipline required to develop production-quality
@@ -731,8 +731,8 @@ difficult issues surrounding parallelism and persistence.
In addition, there are a growing number of parallel library functions,
particularly for numeric computation.
-Even better, some libraries take advantage of special-purpose
-hardware such as vector units and general-purpose graphical processing
+Even better, some libraries take advantage of special\-/purpose
+hardware such as vector units and general\-/purpose graphical processing
units (GPGPUs).
Taking this approach often sacrifices some performance, at least when
diff --git a/perfbook.tex b/perfbook.tex
index 95902be..34059e0 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -19,6 +19,7 @@
\usepackage{enumerate}
\usepackage{ifthen}
\usepackage{xcolor}
+\usepackage[shortcuts]{extdash}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
% \usepackage[strings]{underscore}
diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex
index 97f46fc..9ed50fe 100644
--- a/toolsoftrade/toolsoftrade.tex
+++ b/toolsoftrade/toolsoftrade.tex
@@ -785,7 +785,7 @@ values of \co{x} stored by \co{lock_writer()}.
One possible exception to this rule is ``transactional memory'',
which is currently a research topic.
- Transactional-memory semantics can be loosely thought of as those
+ Transactional\-/memory semantics can be loosely thought of as those
of a single global lock with optimizations permitted and
with the addition of rollback~\cite{HansJBoehm2009HOTPAR}.
} \QuickQuizEnd
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/5] formal/ppcmem: Avoid break-line after 'lines' in source
2016-08-08 15:00 [PATCH 0/5] Several cosmetic fixes Akira Yokosawa
2016-08-08 15:02 ` [PATCH 1/5] Trial use of extdash package with shortcuts option Akira Yokosawa
@ 2016-08-08 15:03 ` Akira Yokosawa
2016-08-08 15:05 ` [PATCH 3/5] Add \nbco{} command for code snippet without line break Akira Yokosawa
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-08 15:03 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From 27111136894e2086427460036d1002179bd6aad2 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 5 Aug 2016 07:24:29 +0900
Subject: [PATCH 2/5] formal/ppcmem: Avoid break-line after 'lines' in source
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
formal/ppcmem.tex | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/formal/ppcmem.tex b/formal/ppcmem.tex
index 8fb1dd9..cf637ad 100644
--- a/formal/ppcmem.tex
+++ b/formal/ppcmem.tex
@@ -133,8 +133,9 @@ in actual use.
} \QuickQuizEnd
Lines~8-17 are the lines of code for each process. A given process
-can have empty lines, as is the case for P0's line~11 and P1's lines
-12-17. Labels and branches are permitted, as demonstrated by the branch
+can have empty lines, as is the case for P0's line~11 and P1's
+lines~12-17.
+Labels and branches are permitted, as demonstrated by the branch
on line~14 to the label on line~17. That said, too-free use of branches
will expand the state space. Use of loops is a particularly good way to
explode your state space.
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 3/5] Add \nbco{} command for code snippet without line break
2016-08-08 15:00 [PATCH 0/5] Several cosmetic fixes Akira Yokosawa
2016-08-08 15:02 ` [PATCH 1/5] Trial use of extdash package with shortcuts option Akira Yokosawa
2016-08-08 15:03 ` [PATCH 2/5] formal/ppcmem: Avoid break-line after 'lines' in source Akira Yokosawa
@ 2016-08-08 15:05 ` Akira Yokosawa
2016-08-08 15:06 ` [PATCH 4/5] Use \ldots for ellipsis Akira Yokosawa
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-08 15:05 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From 3c752419a442afc8d6763ca0e46f77fd8ee14efe Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 5 Aug 2016 21:03:23 +0900
Subject: [PATCH 3/5] Add \nbco{} command for code snippet without line break
This commit also replaces an instance of \co{} command in
formal/ppcmem.tex with the \nbco{} command
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
formal/ppcmem.tex | 2 +-
perfbook.tex | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/formal/ppcmem.tex b/formal/ppcmem.tex
index cf637ad..c5ec6ed 100644
--- a/formal/ppcmem.tex
+++ b/formal/ppcmem.tex
@@ -96,7 +96,7 @@ In the example, line~1 identifies the type of system (``ARM'' or ``PPC'')
and contains the title for the model. Line~2 provides a place for an
alternative name for the test, which you will usually want to leave
blank as shown in the above example. Comments can be inserted between
-lines~2 and~3 using the OCaml (or Pascal) syntax of \co{(* *)}.
+lines~2 and~3 using the OCaml (or Pascal) syntax of \nbco{(* *)}.
Lines~3-6 give initial values for all registers; each is of the form
\co{P:R=V}, where \co{P} is the process identifier, \co{R} is the register
diff --git a/perfbook.tex b/perfbook.tex
index 34059e0..35d6ced 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -61,6 +61,7 @@
\makeatother
% --- End of workaround for Fedora 23 Texlive bug
\newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}}
+\newcommand{\nbco}[1]{\lstinline[breaklines=false,breakatwhitespace=false]{#1}}
\title{Is Parallel Programming Hard, And, If So, What Can You Do About It?}
\author{
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 4/5] Use \ldots for ellipsis
2016-08-08 15:00 [PATCH 0/5] Several cosmetic fixes Akira Yokosawa
` (2 preceding siblings ...)
2016-08-08 15:05 ` [PATCH 3/5] Add \nbco{} command for code snippet without line break Akira Yokosawa
@ 2016-08-08 15:06 ` Akira Yokosawa
2016-08-08 15:07 ` [PATCH 5/5] Trial of marking up numbers in text Akira Yokosawa
2016-08-08 16:36 ` [PATCH 0/5] Several cosmetic fixes Paul E. McKenney
5 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-08 15:06 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From d57d8335c9aef3801ee1c3719987266567760729 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 6 Aug 2016 11:14:23 +0900
Subject: [PATCH 4/5] Use \ldots for ellipsis
This commit replaces "..." with \ldots with enhancement provided
by the "ellipsis" package. This way is said to be better looking.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
SMPdesign/partexercises.tex | 4 ++--
advsync/memorybarriers.tex | 2 +-
appendix/rcuhist/RCUinLinux.tex | 2 +-
appendix/whymb/whymemorybarriers.tex | 2 +-
locking/locking.tex | 2 +-
perfbook.tex | 2 ++
rt/rt.tex | 2 +-
7 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/SMPdesign/partexercises.tex b/SMPdesign/partexercises.tex
index 9773c23..ca16dea 100644
--- a/SMPdesign/partexercises.tex
+++ b/SMPdesign/partexercises.tex
@@ -274,9 +274,9 @@ so that the first element left-enqueued into an empty queue is numbered
zero and the first element right-enqueued into an empty queue is numbered
one.
A series of elements left-enqueued into an otherwise-idle queue would
-be assigned decreasing numbers (-1, -2, -3, ...), while a series of
+be assigned decreasing numbers (-1, -2, -3, \ldots), while a series of
elements right-enqueued into an otherwise-idle queue would be assigned
-increasing numbers (2, 3, 4, ...).
+increasing numbers (2, 3, 4, \ldots).
A key point is that it is not necessary to actually represent a given
element's number, as this number will be implied by its position in
the queue.
diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index efbd4a2..27180a7 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -207,7 +207,7 @@ greatly \emph{increase} the probability of failure in this run.
} \QuickQuizEnd
\QuickQuiz{}
- Great... So how do I fix it?
+ Great \ldots So how do I fix it?
\QuickQuizAnswer{
The easiest fix is to replace each of the \co{barrier()}s on
line~12 and line~20 with an \co{smp_mb()}.
diff --git a/appendix/rcuhist/RCUinLinux.tex b/appendix/rcuhist/RCUinLinux.tex
index fa62087..faecf61 100644
--- a/appendix/rcuhist/RCUinLinux.tex
+++ b/appendix/rcuhist/RCUinLinux.tex
@@ -180,7 +180,7 @@ Other changes include:
Therefore, if someone ever wants to run Linux on a system with
16,777,216 CPUs, RCU is ready for them!
Give or take the response-time implications of scanning
- through 16 million per-CPU data elements...
+ through 16 million per-CPU data elements \ldots
\end{enumerate}
\subsection{2.6.34 Linux Kernel}
diff --git a/appendix/whymb/whymemorybarriers.tex b/appendix/whymb/whymemorybarriers.tex
index 0351407..101f5e7 100644
--- a/appendix/whymb/whymemorybarriers.tex
+++ b/appendix/whymb/whymemorybarriers.tex
@@ -1682,7 +1682,7 @@ of course, all bets are off.
Furthermore,
all of Linux's locking primitives (spinlocks, reader-writer locks,
-semaphores, RCU, ...) include any needed barrier primitives.
+semaphores, RCU, \ldots) include any needed barrier primitives.
So if you are working with code that uses these primitives, you don't
even need to worry about Linux's memory-ordering primitives.
diff --git a/locking/locking.tex b/locking/locking.tex
index 4d4b94b..9eafcf5 100644
--- a/locking/locking.tex
+++ b/locking/locking.tex
@@ -1142,7 +1142,7 @@ rests with the developer.
``gray magic.''\footnote{
Thanks to Alexey Roytman for this decription.}
As such, empty critical sections are almost never used in practice.
- Nevertheless, pressing on into this gray area...
+ Nevertheless, pressing on into this gray area \ldots
One historical use of empty critical sections appeared in the
networking stack of the 2.4 Linux kernel.
diff --git a/perfbook.tex b/perfbook.tex
index 35d6ced..bdd42ad 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -33,6 +33,8 @@
\usepackage[all]{hypcap} % for going to the top of figure and table
\usepackage{epigraph}
\setlength{\epigraphwidth}{2.3in}
+\usepackage[xspace]{ellipsis}
+
% custom packages
\usepackage{qqz}
diff --git a/rt/rt.tex b/rt/rt.tex
index f1ed929..1fe1e7c 100644
--- a/rt/rt.tex
+++ b/rt/rt.tex
@@ -282,7 +282,7 @@ real-time systems.
And isn't worst-case response time all that most
real-time systems really care about?
\QuickQuizAnswer{
- Yes, but...
+ Yes, but \ldots
Those queueing-theory results assume infinite ``calling populations'',
which in the Linux kernel might correspond to an infinite number
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 5/5] Trial of marking up numbers in text
2016-08-08 15:00 [PATCH 0/5] Several cosmetic fixes Akira Yokosawa
` (3 preceding siblings ...)
2016-08-08 15:06 ` [PATCH 4/5] Use \ldots for ellipsis Akira Yokosawa
@ 2016-08-08 15:07 ` Akira Yokosawa
2016-08-08 16:36 ` [PATCH 0/5] Several cosmetic fixes Paul E. McKenney
5 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-08 15:07 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From 572ae1f4ad166e144ceb0306100cb4f5a1235a4e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 6 Aug 2016 23:56:13 +0900
Subject: [PATCH 5/5] Trial of marking up numbers in text
Use \txnum{} to indicate it is in normal sentence.
Use \conum{} to indicate the value is mentioned in code snippets.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
SMPdesign/SMPdesign.tex | 4 ++--
SMPdesign/partexercises.tex | 4 ++--
appendix/rcuimpl/rcupreempt.tex | 6 +++---
datastruct/datastruct.tex | 2 +-
future/htm.tex | 2 +-
perfbook.tex | 2 ++
toolsoftrade/toolsoftrade.tex | 2 +-
7 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
index 0a65c38..3abfab5 100644
--- a/SMPdesign/SMPdesign.tex
+++ b/SMPdesign/SMPdesign.tex
@@ -995,9 +995,9 @@ type \co{struct percpumempool}.
Both of these data structures have arrays of pointers to blocks
in their \co{pool} fields, which are filled from index zero upwards.
Thus, if \co{globalmem.pool[3]} is \co{NULL}, then the remainder of
-the array from index 4 up must also be \co{NULL}.
+the array from index \conum{4} up must also be \co{NULL}.
The \co{cur} fields contain the index of the highest-numbered full
-element of the \co{pool} array, or -1 if all elements are empty.
+element of the \co{pool} array, or \conum{-1} if all elements are empty.
All elements from \co{globalmem.pool[0]} through
\co{globalmem.pool[globalmem.cur]} must be full, and all the rest
must be empty.\footnote{
diff --git a/SMPdesign/partexercises.tex b/SMPdesign/partexercises.tex
index ca16dea..f812767 100644
--- a/SMPdesign/partexercises.tex
+++ b/SMPdesign/partexercises.tex
@@ -274,9 +274,9 @@ so that the first element left-enqueued into an empty queue is numbered
zero and the first element right-enqueued into an empty queue is numbered
one.
A series of elements left-enqueued into an otherwise-idle queue would
-be assigned decreasing numbers (-1, -2, -3, \ldots), while a series of
+be assigned decreasing numbers (\txnum{-1}, \txnum{-2}, \txnum{-3}, \ldots), while a series of
elements right-enqueued into an otherwise-idle queue would be assigned
-increasing numbers (2, 3, 4, \ldots).
+increasing numbers (\txnum{2}, \txnum{3}, \txnum{4}, \ldots).
A key point is that it is not necessary to actually represent a given
element's number, as this number will be implied by its position in
the queue.
diff --git a/appendix/rcuimpl/rcupreempt.tex b/appendix/rcuimpl/rcupreempt.tex
index fbb41b8..55a72fb 100644
--- a/appendix/rcuimpl/rcupreempt.tex
+++ b/appendix/rcuimpl/rcupreempt.tex
@@ -213,8 +213,8 @@ cause any individual counter to remain non-zero or even to go negative.
For example, suppose that a task calls \co{rcu_read_lock()} on
one CPU, is preempted, resumes on another CPU, and then calls
\co{rcu_read_unlock()}.
-The first CPU's counter will then be +1 and the second CPU's counter
-will be -1, however, they will still sum to zero.
+The first CPU's counter will then be \conum{+1} and the second CPU's counter
+will be \conum{-1}, however, they will still sum to zero.
Regardless of possible preemption, when the sum of the old counter
elements does go to zero, it is safe to move to the next grace-period
stage, as shown on the right-hand side of the above figure.
@@ -1369,7 +1369,7 @@ a full grace period, and hence it is safe to do:
\item Task~B is migrated to CPU 2.
\item Task~B completes its RCU read-side critical section, and
executes \co{rcu_read_unlock()}, which decrements
- \co{per_cpu(rcu_flipctr, 2)[0]}, which is now -1.
+ \co{per_cpu(rcu_flipctr, 2)[0]}, which is now \conum{-1}.
\item CPU 1 now adds \co{per_cpu(rcu_flipctr, 1)[0]} and
\co{per_cpu(rcu_flipctr, 2)[0]} to its
local variable \co{sum}, obtaining the value zero.
diff --git a/datastruct/datastruct.tex b/datastruct/datastruct.tex
index 4807223..80af11e 100644
--- a/datastruct/datastruct.tex
+++ b/datastruct/datastruct.tex
@@ -1073,7 +1073,7 @@ as specified by the \co{->ht_nbuckets} field on line~13.
The size is stored in the same structure containing the array of
buckets (\co{->ht_bkt[]} on line~24) in order to avoid mismatches between
the size and the array.
-The \co{->ht_resize_cur} field on line~14 is equal to -1 unless a resize
+The \co{->ht_resize_cur} field on line~14 is equal to \conum{-1} unless a resize
operation
is in progress, in which case it indicates the index of the bucket whose
elements are being inserted into the new hash table, which is referenced
diff --git a/future/htm.tex b/future/htm.tex
index c64bdf7..8ba5dd5 100644
--- a/future/htm.tex
+++ b/future/htm.tex
@@ -639,7 +639,7 @@ semantics of locking, but loses locking's time-based messaging semantics.
When worker threads complete their feed, they must disentangle
themselves from the rest of the application and place a status
value in a per-thread \co{my_status} variable that is initialized
- to -1.
+ to \conum{-1}.
Threads do not exit; they instead are placed on a thread pool
to accommodate later processing requirements.
The control thread assigns (and re-assigns) worker threads as
diff --git a/perfbook.tex b/perfbook.tex
index bdd42ad..7baa768 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -64,6 +64,8 @@
% --- End of workaround for Fedora 23 Texlive bug
\newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}}
\newcommand{\nbco}[1]{\lstinline[breaklines=false,breakatwhitespace=false]{#1}}
+\newcommand{\conum}[1]{\nbco{#1}}
+\newcommand{\txnum}[1]{$#1$}
\title{Is Parallel Programming Hard, And, If So, What Can You Do About It?}
\author{
diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex
index 9ed50fe..6b41b0a 100644
--- a/toolsoftrade/toolsoftrade.tex
+++ b/toolsoftrade/toolsoftrade.tex
@@ -256,7 +256,7 @@ shell-script \co{wait} command.
Each pass through the loop spanning lines~6-15 waits on one child process.
Line~7 invokes the \co{wait()} primitive, which blocks until a child process
exits, and returns that child's process ID.
-If the process ID is instead -1, this indicates that the \co{wait()}
+If the process ID is instead \conum{-1}, this indicates that the \co{wait()}
primitive was unable to wait on a child.
If so, line~9 checks for the \co{ECHILD} errno, which indicates that there
are no more child processes, so that line~10 exits the loop.
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 0/5] Several cosmetic fixes
2016-08-08 15:00 [PATCH 0/5] Several cosmetic fixes Akira Yokosawa
` (4 preceding siblings ...)
2016-08-08 15:07 ` [PATCH 5/5] Trial of marking up numbers in text Akira Yokosawa
@ 2016-08-08 16:36 ` Paul E. McKenney
2016-08-09 14:04 ` [PATCH v2 0/1] Trial of replacing hyphens with minus signs Akira Yokosawa
5 siblings, 1 reply; 10+ messages in thread
From: Paul E. McKenney @ 2016-08-08 16:36 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Tue, Aug 09, 2016 at 12:00:35AM +0900, Akira Yokosawa wrote:
> >From 572ae1f4ad166e144ceb0306100cb4f5a1235a4e Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Mon, 8 Aug 2016 23:06:10 +0900
> Subject: [PATCH 0/5] Several cosmetic fixes
>
> Hi,
>
> This patch series consists of mostly cosmetic fixes.
>
> 1st one introduces 'extdash' package to enable hyphenation
> of fairly long cmnpound words such as "eventually-consistent".
I like this one a lot! Much better than looking each word up in
the dictionary and ending up with something like this:
e\-ven\-tu\-al\-ly-con\-sist\-ent
I had to do this a lot in a recent paper, quite annoying. Also makes
string-searching painful.
The form enabled by your patch is a -lot- better, thank you!
eventually\-/consistent
> 2nd one removes a line break between "lines" and "n-m".
Good!
> 3rd one adds \nbco{} command ("nbco" stands for non breakable co)
> to make sure short code snippet not to be broken.
This is very nice, good show!
> 4th one replaces "..." with \ldots for better looking ellipsis.
I was not all that excited about this one, but ended up taking it.
There aren't -that- many ellipses, and this patch really does make
them look better.
> 5th one is just a trial of marking up numbers to avoid using
> hyphens as minus signs. There are two types of mark up.
> One is \txnum{} which is to be used for values in running text.
> The other is \conum{} which is to be used for a value which appears
> in a nearby code snippet. This patch contains small number of example
> uses. I don't use math mode directly because you can modify the
> appearance of each mark-up by modifying just the definition in the
> preamble.
>
> The effect of this series can be seen in the first paragraph of
> Section 6.1.2.3 "Hashed Double-Ended Queue" in the two column layout.
> Before the changes, the following line break looks ugly.
>
> ... decreasing numbers (-1, -2, -
> 3, ...), while a series of ...
>
> There are other ways to prevent the line break here, but I think using
> math mode or \nbco{} command is natural enough.
But I did not take this one. I am a bit concerned about everyone having
to type extra LaTeX commands for each and every number.
You could probably talk me into something for only the negative numbers.
Is it possible to make the "-" signs look nicer while still having the
positive and negative numbers not look different from each other?
Thanx, Paul
> Thanks, Akira
>
> ----------------------------------------------
> Akira Yokosawa (5):
> Trial use of extdash package with shortcuts option
> formal/ppcmem: Avoid break-line after 'lines' in source
> Add \nbco{} command for code snippet without line break
> Use \ldots for ellipsis
> Trial of marking up numbers in text
>
> SMPdesign/SMPdesign.tex | 4 ++--
> SMPdesign/partexercises.tex | 4 ++--
> advsync/memorybarriers.tex | 2 +-
> appendix/rcuhist/RCUinLinux.tex | 2 +-
> appendix/rcuimpl/rcupreempt.tex | 6 +++---
> appendix/whymb/whymemorybarriers.tex | 2 +-
> count/count.tex | 4 ++--
> datastruct/datastruct.tex | 2 +-
> formal/ppcmem.tex | 7 ++++---
> future/htm.tex | 2 +-
> howto/howto.tex | 2 +-
> intro/intro.tex | 6 +++---
> locking/locking.tex | 2 +-
> perfbook.tex | 6 ++++++
> rt/rt.tex | 2 +-
> toolsoftrade/toolsoftrade.tex | 4 ++--
> 16 files changed, 32 insertions(+), 25 deletions(-)
>
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v2 0/1] Trial of replacing hyphens with minus signs
2016-08-08 16:36 ` [PATCH 0/5] Several cosmetic fixes Paul E. McKenney
@ 2016-08-09 14:04 ` Akira Yokosawa
2016-08-09 14:06 ` [PATCH v2 1/1] Trial of replacing hyphens of negative values with minus Akira Yokosawa
2016-08-10 22:42 ` [PATCH v2 0/1] Trial of replacing hyphens with minus signs Paul E. McKenney
0 siblings, 2 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-09 14:04 UTC (permalink / raw)
To: paulmck; +Cc: perfbook, Akira Yokosawa
From f4068f222bfa4f1cb60b9c16e9228990bc886280 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Tue, 9 Aug 2016 22:28:34 +0900
Subject: [PATCH v2 0/1] Trial of replacing hyphens with minus signs
This is round two of my attempt to avoid using hyphens as minus signs.
First of all, I didn't intend to mark up every number in the text.
The reason I used two latex commands was to make it easy to try
several different combinations of appearance in the resulting PDF.
Once we choose one combination, we can replace the mark-up commands
by automatic scripting. I prepared two types of mark up because
there already exist numbers enclosed in \co{}.
I should have made this point clear in the previous series cover
letter.
This time, I choose the simple math mode for negative numbers. I think
this is acceptable enough. I'm not sure if we should also use \co{}
for some negative numbers. This can be discussed later.
BTW, I used a script to find candidates of negative numbers.
Although it outputs a lot of false positives within verbatim and \co{}
code snippets, it is still useful as hints.
Following is the diff of "before" and "after" of the output of the
script. I hope this can help you grasp what it looks like.
Thanks, Akira
------
--- /tmp/before 2016-08-09 22:11:29.061603725 +0900
+++ /tmp/after 2016-08-09 22:11:50.129602753 +0900
@@ -1,8 +1,4 @@
-./future/htm.tex:642: to -1.
./future/htm.tex:656: 1 int my_status = -1; /* Thread local. */
-./SMPdesign/beyond.tex:272:which must be initialized to all [-1,-1].
-./SMPdesign/partexercises.tex:277:be assigned decreasing numbers (-1, -2, -3, \ldots), while a series of
-./SMPdesign/SMPdesign.tex:1000:element of the \co{pool} array, or -1 if all elements are empty.
./count/count.tex:787: 40 exit(-1);
./count/count.tex:3062: 10 exit(-1);
./together/applyrcu.tex:148: 36 exit(-1);
@@ -14,7 +10,6 @@
./toolsoftrade/toolsoftrade.tex:188: 7 exit(-1);
./toolsoftrade/toolsoftrade.tex:228: 8 if (pid == -1) {
./toolsoftrade/toolsoftrade.tex:232: 12 exit(-1);
-./toolsoftrade/toolsoftrade.tex:259:If the process ID is instead -1, this indicates that the \co{wait()}
./toolsoftrade/toolsoftrade.tex:294: 12 exit(-1);
./toolsoftrade/toolsoftrade.tex:395: 18 exit(-1);
./toolsoftrade/toolsoftrade.tex:399: 22 exit(-1);
@@ -34,15 +29,7 @@
./toolsoftrade/toolsoftrade.tex:739: 19 exit(-1);
./toolsoftrade/toolsoftrade.tex:883: 25 exit(-1);
./toolsoftrade/toolsoftrade.tex:890: 32 exit(-1);
-./appendix/questions/after.tex:146:17563: & 1152396.251585 & (-16.928) & 27 & 27 & 27 \\
-./appendix/questions/after.tex:147:18004: & 1152396.252581 & (-12.875) & 24 & 24 & 24 \\
-./appendix/questions/after.tex:148:18163: & 1152396.252955 & (-19.073) & 18 & 18 & 18 \\
-./appendix/questions/after.tex:149:18765: & 1152396.254449 & (-148.773) & 216 & 216 & 216 \\
-./appendix/questions/after.tex:150:19863: & 1152396.256960 & (-6.914) & 18 & 18 & 18 \\
-./appendix/questions/after.tex:151:21644: & 1152396.260959 & (-5.960) & 18 & 18 & 18 \\
-./appendix/questions/after.tex:152:23408: & 1152396.264957 & (-20.027) & 15 & 15 & 15 \\
./rt/rt.tex:1360: \co{echo -1 > /proc/sys/kernel/sched_rt_runtime_us}
./rt/rt.tex:1711: 3 exit(-1);
./rt/rt.tex:1715: 7 exit(-1);
./rt/rt.tex:1719:11 exit(-1);
-./datastruct/datastruct.tex:1076:The \co{->ht_resize_cur} field on line~14 is equal to -1 unless a resize
------
Akira Yokosawa (1):
Trial of replacing hyphens of negative values with minus signs
SMPdesign/SMPdesign.tex | 2 +-
SMPdesign/beyond.tex | 2 +-
SMPdesign/partexercises.tex | 2 +-
appendix/questions/after.tex | 14 +++++++-------
datastruct/datastruct.tex | 2 +-
future/htm.tex | 2 +-
toolsoftrade/toolsoftrade.tex | 2 +-
utilities/findminusnum.sh | 29 +++++++++++++++++++++++++++++
8 files changed, 42 insertions(+), 13 deletions(-)
create mode 100644 utilities/findminusnum.sh
--
1.9.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v2 1/1] Trial of replacing hyphens of negative values with minus
2016-08-09 14:04 ` [PATCH v2 0/1] Trial of replacing hyphens with minus signs Akira Yokosawa
@ 2016-08-09 14:06 ` Akira Yokosawa
2016-08-10 22:42 ` [PATCH v2 0/1] Trial of replacing hyphens with minus signs Paul E. McKenney
1 sibling, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2016-08-09 14:06 UTC (permalink / raw)
To: paulmck; +Cc: perfbook, Akira Yokosawa
From f4068f222bfa4f1cb60b9c16e9228990bc886280 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Tue, 9 Aug 2016 22:16:51 +0900
Subject: [PATCH v2 1/1] Trial of replacing hyphens of negative values with minus
signs
This commit encloses negative values with hyphens within
math mode.
It also adds a script "findminusnum.sh" I used to search
candidates. It is by no means complete, but it can still
be used as a hint in the future.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
SMPdesign/SMPdesign.tex | 2 +-
SMPdesign/beyond.tex | 2 +-
SMPdesign/partexercises.tex | 2 +-
appendix/questions/after.tex | 14 +++++++-------
datastruct/datastruct.tex | 2 +-
future/htm.tex | 2 +-
toolsoftrade/toolsoftrade.tex | 2 +-
utilities/findminusnum.sh | 29 +++++++++++++++++++++++++++++
8 files changed, 42 insertions(+), 13 deletions(-)
create mode 100644 utilities/findminusnum.sh
diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
index 0a65c38..4006186 100644
--- a/SMPdesign/SMPdesign.tex
+++ b/SMPdesign/SMPdesign.tex
@@ -997,7 +997,7 @@ in their \co{pool} fields, which are filled from index zero upwards.
Thus, if \co{globalmem.pool[3]} is \co{NULL}, then the remainder of
the array from index 4 up must also be \co{NULL}.
The \co{cur} fields contain the index of the highest-numbered full
-element of the \co{pool} array, or -1 if all elements are empty.
+element of the \co{pool} array, or $-1$ if all elements are empty.
All elements from \co{globalmem.pool[0]} through
\co{globalmem.pool[globalmem.cur]} must be full, and all the rest
must be empty.\footnote{
diff --git a/SMPdesign/beyond.tex b/SMPdesign/beyond.tex
index 13dbb71..c64f580 100644
--- a/SMPdesign/beyond.tex
+++ b/SMPdesign/beyond.tex
@@ -269,7 +269,7 @@ Figure~\ref{fig:SMPdesign:Partitioned Parallel Solver Pseudocode}
is similar to SEQ, but has a few important differences.
First, each child thread has its own \co{visited} array, passed in by
the parent as shown on line~1,
-which must be initialized to all [-1,-1].
+which must be initialized to all [$-1$, $-1$].
Line~7 stores a pointer to this array into the per-thread variable
\co{myvisited} to allow access by helper functions, and similarly stores
a pointer to the local visit index.
diff --git a/SMPdesign/partexercises.tex b/SMPdesign/partexercises.tex
index ca16dea..aabcf59 100644
--- a/SMPdesign/partexercises.tex
+++ b/SMPdesign/partexercises.tex
@@ -274,7 +274,7 @@ so that the first element left-enqueued into an empty queue is numbered
zero and the first element right-enqueued into an empty queue is numbered
one.
A series of elements left-enqueued into an otherwise-idle queue would
-be assigned decreasing numbers (-1, -2, -3, \ldots), while a series of
+be assigned decreasing numbers ($-1$, $-2$, $-3$, \ldots), while a series of
elements right-enqueued into an otherwise-idle queue would be assigned
increasing numbers (2, 3, 4, \ldots).
A key point is that it is not necessary to actually represent a given
diff --git a/appendix/questions/after.tex b/appendix/questions/after.tex
index 09f6276..25fea75 100644
--- a/appendix/questions/after.tex
+++ b/appendix/questions/after.tex
@@ -143,13 +143,13 @@ variables increased since the prior snapshot collected by the consumer.
\begin{tabular}{rcrrrr}
seq & time (seconds) & delta~ & a & b & c \\
\hline
-17563: & 1152396.251585 & (-16.928) & 27 & 27 & 27 \\
-18004: & 1152396.252581 & (-12.875) & 24 & 24 & 24 \\
-18163: & 1152396.252955 & (-19.073) & 18 & 18 & 18 \\
-18765: & 1152396.254449 & (-148.773) & 216 & 216 & 216 \\
-19863: & 1152396.256960 & (-6.914) & 18 & 18 & 18 \\
-21644: & 1152396.260959 & (-5.960) & 18 & 18 & 18 \\
-23408: & 1152396.264957 & (-20.027) & 15 & 15 & 15 \\
+17563: & 1152396.251585 & ($-16.928$) & 27 & 27 & 27 \\
+18004: & 1152396.252581 & ($-12.875$) & 24 & 24 & 24 \\
+18163: & 1152396.252955 & ($-19.073$) & 18 & 18 & 18 \\
+18765: & 1152396.254449 & ($-148.773$) & 216 & 216 & 216 \\
+19863: & 1152396.256960 & ($-6.914$) & 18 & 18 & 18 \\
+21644: & 1152396.260959 & ($-5.960$) & 18 & 18 & 18 \\
+23408: & 1152396.264957 & ($-20.027$) & 15 & 15 & 15 \\
\end{tabular}
\caption{``After'' Program Sample Output}
\label{tab:app:questions:After Program Sample Output}
diff --git a/datastruct/datastruct.tex b/datastruct/datastruct.tex
index 4807223..b86527f 100644
--- a/datastruct/datastruct.tex
+++ b/datastruct/datastruct.tex
@@ -1073,7 +1073,7 @@ as specified by the \co{->ht_nbuckets} field on line~13.
The size is stored in the same structure containing the array of
buckets (\co{->ht_bkt[]} on line~24) in order to avoid mismatches between
the size and the array.
-The \co{->ht_resize_cur} field on line~14 is equal to -1 unless a resize
+The \co{->ht_resize_cur} field on line~14 is equal to $-1$ unless a resize
operation
is in progress, in which case it indicates the index of the bucket whose
elements are being inserted into the new hash table, which is referenced
diff --git a/future/htm.tex b/future/htm.tex
index c64bdf7..ac52234 100644
--- a/future/htm.tex
+++ b/future/htm.tex
@@ -639,7 +639,7 @@ semantics of locking, but loses locking's time-based messaging semantics.
When worker threads complete their feed, they must disentangle
themselves from the rest of the application and place a status
value in a per-thread \co{my_status} variable that is initialized
- to -1.
+ to $-1$.
Threads do not exit; they instead are placed on a thread pool
to accommodate later processing requirements.
The control thread assigns (and re-assigns) worker threads as
diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex
index 9ed50fe..c6f0a91 100644
--- a/toolsoftrade/toolsoftrade.tex
+++ b/toolsoftrade/toolsoftrade.tex
@@ -256,7 +256,7 @@ shell-script \co{wait} command.
Each pass through the loop spanning lines~6-15 waits on one child process.
Line~7 invokes the \co{wait()} primitive, which blocks until a child process
exits, and returns that child's process ID.
-If the process ID is instead -1, this indicates that the \co{wait()}
+If the process ID is instead $-1$, this indicates that the \co{wait()}
primitive was unable to wait on a child.
If so, line~9 checks for the \co{ECHILD} errno, which indicates that there
are no more child processes, so that line~10 exits the loop.
diff --git a/utilities/findminusnum.sh b/utilities/findminusnum.sh
new file mode 100644
index 0000000..14626ff
--- /dev/null
+++ b/utilities/findminusnum.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Find hypens used as minus signs in text mode
+#
+# This is an incomplete script.
+# False positives will include those of verbatim and \co{} arguments.
+# Use the result just for hints.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can access it online at
+# http://www.gnu.org/licenses/gpl-2.0.html.
+#
+# Copyright (C) Akira Yokosawa, 2016
+#
+# Authors: Akira Yokosawa <akiyks@gmain.com>
+
+find . -name "*.tex" -exec grep -nH -E '[[:space:]+|\[|(]\-[0-9]+' {} + | \
+grep -v "perfbook_flat.tex" | grep -v "qqz.tex" | grep -v "appendix/rcuimpl"
+
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH v2 0/1] Trial of replacing hyphens with minus signs
2016-08-09 14:04 ` [PATCH v2 0/1] Trial of replacing hyphens with minus signs Akira Yokosawa
2016-08-09 14:06 ` [PATCH v2 1/1] Trial of replacing hyphens of negative values with minus Akira Yokosawa
@ 2016-08-10 22:42 ` Paul E. McKenney
1 sibling, 0 replies; 10+ messages in thread
From: Paul E. McKenney @ 2016-08-10 22:42 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Tue, Aug 09, 2016 at 11:04:34PM +0900, Akira Yokosawa wrote:
> >From f4068f222bfa4f1cb60b9c16e9228990bc886280 Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Tue, 9 Aug 2016 22:28:34 +0900
> Subject: [PATCH v2 0/1] Trial of replacing hyphens with minus signs
>
> This is round two of my attempt to avoid using hyphens as minus signs.
And I am good with this one. The positive and negative numerals appear
to use the same glyphs, so postive and negative numbers look the same,
which is good.
> First of all, I didn't intend to mark up every number in the text.
> The reason I used two latex commands was to make it easy to try
> several different combinations of appearance in the resulting PDF.
> Once we choose one combination, we can replace the mark-up commands
> by automatic scripting. I prepared two types of mark up because
> there already exist numbers enclosed in \co{}.
But if they are in \co{}, it makes sense to use hyphens, which is
the tradition for typewriter/command-line display.
> I should have made this point clear in the previous series cover
> letter.
>
> This time, I choose the simple math mode for negative numbers. I think
> this is acceptable enough. I'm not sure if we should also use \co{}
> for some negative numbers. This can be discussed later.
>
> BTW, I used a script to find candidates of negative numbers.
> Although it outputs a lot of false positives within verbatim and \co{}
> code snippets, it is still useful as hints.
>
> Following is the diff of "before" and "after" of the output of the
> script. I hope this can help you grasp what it looks like.
Anyway, the patch looked good, so I pulled it in.
Thanx, Paul
> Thanks, Akira
>
> ------
> --- /tmp/before 2016-08-09 22:11:29.061603725 +0900
> +++ /tmp/after 2016-08-09 22:11:50.129602753 +0900
> @@ -1,8 +1,4 @@
> -./future/htm.tex:642: to -1.
> ./future/htm.tex:656: 1 int my_status = -1; /* Thread local. */
> -./SMPdesign/beyond.tex:272:which must be initialized to all [-1,-1].
> -./SMPdesign/partexercises.tex:277:be assigned decreasing numbers (-1, -2, -3, \ldots), while a series of
> -./SMPdesign/SMPdesign.tex:1000:element of the \co{pool} array, or -1 if all elements are empty.
> ./count/count.tex:787: 40 exit(-1);
> ./count/count.tex:3062: 10 exit(-1);
> ./together/applyrcu.tex:148: 36 exit(-1);
> @@ -14,7 +10,6 @@
> ./toolsoftrade/toolsoftrade.tex:188: 7 exit(-1);
> ./toolsoftrade/toolsoftrade.tex:228: 8 if (pid == -1) {
> ./toolsoftrade/toolsoftrade.tex:232: 12 exit(-1);
> -./toolsoftrade/toolsoftrade.tex:259:If the process ID is instead -1, this indicates that the \co{wait()}
> ./toolsoftrade/toolsoftrade.tex:294: 12 exit(-1);
> ./toolsoftrade/toolsoftrade.tex:395: 18 exit(-1);
> ./toolsoftrade/toolsoftrade.tex:399: 22 exit(-1);
> @@ -34,15 +29,7 @@
> ./toolsoftrade/toolsoftrade.tex:739: 19 exit(-1);
> ./toolsoftrade/toolsoftrade.tex:883: 25 exit(-1);
> ./toolsoftrade/toolsoftrade.tex:890: 32 exit(-1);
> -./appendix/questions/after.tex:146:17563: & 1152396.251585 & (-16.928) & 27 & 27 & 27 \\
> -./appendix/questions/after.tex:147:18004: & 1152396.252581 & (-12.875) & 24 & 24 & 24 \\
> -./appendix/questions/after.tex:148:18163: & 1152396.252955 & (-19.073) & 18 & 18 & 18 \\
> -./appendix/questions/after.tex:149:18765: & 1152396.254449 & (-148.773) & 216 & 216 & 216 \\
> -./appendix/questions/after.tex:150:19863: & 1152396.256960 & (-6.914) & 18 & 18 & 18 \\
> -./appendix/questions/after.tex:151:21644: & 1152396.260959 & (-5.960) & 18 & 18 & 18 \\
> -./appendix/questions/after.tex:152:23408: & 1152396.264957 & (-20.027) & 15 & 15 & 15 \\
> ./rt/rt.tex:1360: \co{echo -1 > /proc/sys/kernel/sched_rt_runtime_us}
> ./rt/rt.tex:1711: 3 exit(-1);
> ./rt/rt.tex:1715: 7 exit(-1);
> ./rt/rt.tex:1719:11 exit(-1);
> -./datastruct/datastruct.tex:1076:The \co{->ht_resize_cur} field on line~14 is equal to -1 unless a resize
> ------
>
> Akira Yokosawa (1):
> Trial of replacing hyphens of negative values with minus signs
>
> SMPdesign/SMPdesign.tex | 2 +-
> SMPdesign/beyond.tex | 2 +-
> SMPdesign/partexercises.tex | 2 +-
> appendix/questions/after.tex | 14 +++++++-------
> datastruct/datastruct.tex | 2 +-
> future/htm.tex | 2 +-
> toolsoftrade/toolsoftrade.tex | 2 +-
> utilities/findminusnum.sh | 29 +++++++++++++++++++++++++++++
> 8 files changed, 42 insertions(+), 13 deletions(-)
> create mode 100644 utilities/findminusnum.sh
>
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread