-
Notifications
You must be signed in to change notification settings - Fork 0
/
perfbook.tex
287 lines (252 loc) · 8.64 KB
/
perfbook.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
\documentclass[10pt,twocolumn]{pfbook} % book class customized for perfbook
% For arxiv.org, must be on or before line 5:
\pdfoutput=1
% standard packages
% A more pleasant font
\usepackage{lmodern}
\usepackage[T1]{fontenc} % use postscript type 1 fonts
\usepackage[defaultsups]{newtxtext} % use nice, standard fonts for roman
\usepackage{textcomp} % use symbols in TS1 encoding
\renewcommand*\ttdefault{lmtt}
%msfontstub
% Improves the text layout
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
\usepackage{etoolbox}
\usepackage{fixltx2e} % for \textsubscript, nop on Tex Live 2015 and later
\usepackage{float}
\floatstyle{ruled}
\newfloat{listing}{tbhp}{lst}[chapter]
\floatname{listing}{Listing}
\usepackage{lscape}
\usepackage{epsfig}
\usepackage{subfig}
\newsubfloat{listing}
\captionsetup{labelfont=bf}
\captionsetup[listing]{font=small,labelsep=colon}
\captionsetup[subfloat]{font=small}
% \usepackage{breakurl}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{enumitem}
\setlist[description]{style=unboxed}
%\usepackage{enumerate}
\usepackage{ifthen}
\usepackage[table]{xcolor}
\usepackage[shortcuts]{extdash}
\usepackage{changepage}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
% \usepackage[strings]{underscore}
% \usepackage{underscore}
\usepackage{pifont} % special character for qqz reference point
\usepackage{gensymb} % symbols for both text and math modes such as \degree and \micro
\usepackage{verbatimbox}[2014/01/30] % for centering verbatim listing in figure environment
\usepackage[bottom]{footmisc} % place footnotes under floating figures/tables
\usepackage{tabularx}
\usepackage[hyphens]{url}
\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0}]{hyperref}
\usepackage{footnotebackref} % to enable cross-ref of footnote
\usepackage[all]{hypcap} % for going to the top of figure and table
\usepackage{epigraph}
\setlength{\epigraphwidth}{2.6in}
\usepackage[xspace]{ellipsis}
\usepackage{braket} % for \ket{} macro in QC section
\usepackage{siunitx} % for \num{} macro
\sisetup{group-minimum-digits=4,group-separator={,},group-digits=integer}
\usepackage{multirow}
% custom packages
\usepackage{qqz}
\usepackage{origpub}
% custom booleans
\newboolean{inbook}
\setboolean{inbook}{true}
\newcommand{\IfInBook}[2]{\ifthenelse{\boolean{inbook}}{#1}{#2}}
\newboolean{twocolumn}
\setboolean{twocolumn}{true}
\newcommand{\IfTwoColumn}[2]{\ifthenelse{\boolean{twocolumn}}{#1}{#2}}
\newboolean{hardcover}
\setboolean{hardcover}{false}
\newcommand{\IfHardCover}[2]{\ifthenelse{\boolean{hardcover}}{#1}{#2}}
\newboolean{sansserif}
\setboolean{sansserif}{false}
\newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
\newboolean{lmttforcode}
\setboolean{lmttforcode}{true}
\newcommand{\IfLmttForCode}[2]{\ifthenelse{\boolean{lmttforcode}}{#1}{#2}}
\newboolean{tblcptop}
\setboolean{tblcptop}{true}
\newcommand{\IfTblCpTop}[2]{\ifthenelse{\boolean{tblcptop}}{#1}{#2}}
\newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}
\IfSansSerif{
\renewcommand{\familydefault}{\sfdefault}
\normalfont
\usepackage[slantedGreek,scaled=.96]{newtxsf}
}{
\usepackage[slantedGreek]{newtxmath} % math package to be used with newtxtext
% Poor person's slanted shape for roman --- newtxtext lacks slanted shape
\AtBeginDocument{%
\DeclareFontShape{\encodingdefault}{\rmdefault}{m}{sl}{<-> ptmro7t}{}%
\DeclareFontShape{\encodingdefault}{\rmdefault}{b}{sl}{<-> ptmbo7t}{}%
\DeclareFontShape{\encodingdefault}{\rmdefault}{bx}{sl}{<->ssub * ptm/b/sl}{}%
}
}
\newcommand{\LstLineNo}{\makebox[5ex][r]{\arabic{VerbboxLineNo}\hspace{2ex}}}
\usepackage{bm} % for bold math mode fonts --- should be after math mode font choice
\usepackage{booktabs}
\usepackage{arydshln}
\definecolor{lightgray}{gray}{0.9} % for coloring alternate rows in table
\IfLmttForCode{
\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}}
\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{lmtt}}
\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{lmtt}}
\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{lmtt}}
\AtBeginEnvironment{tabularx}{\renewcommand{\ttdefault}{lmtt}}
\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{lmtt}}
\AtBeginEnvironment{listing}{\renewcommand{\ttdefault}{lmtt}}
}{}
\IfTblCpTop{
\floatstyle{plaintop}
\restylefloat{table}
\addtolength{\abovecaptionskip}{-2.5pt}
\setlength{\abovetopsep}{-2pt}
}{}
\captionsetup{hangindent=20pt}
\captionsetup[listing]{hangindent=20pt}
\begin{document}
%%HTMLSKIP
\lstset{
literate={\_}{}{0\discretionary{\_}{}{\_}}%
{\_\_}{}{0\discretionary{\_\_}{}{\_\_}}%
{->}{}{0\discretionary{->}{}{->}}%
}
%%HTMLNOSKIP
% --- Workaround for Fedora 23 Texlive bug
\makeatletter
\renewcommand\lstinline[1][]{%
\leavevmode\bgroup % \hbox\bgroup --> \bgroup
\def\lst@boxpos{b}%
\lsthk@PreSet\lstset{flexiblecolumns,#1}%
\lsthk@TextStyle
\ifnum\iffalse{\fi`}=\z@\fi
\@ifnextchar\bgroup{%
\ifnum`{=\z@}\fi%
\afterassignment\lst@InlineG \let\@let@token}{%
\ifnum`{=\z@}\fi\lstinline@}}
\makeatother
% --- End of workaround for Fedora 23 Texlive bug
\newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}}
\newcommand{\nbco}[1]{\hbox{\lstinline[breaklines=false,breakatwhitespace=false]{#1}}} % no break lines for short snippet
\newcommand{\qco}[1]{``\nbco{#1}''} % \nbco with quotation marks
\newcommand{\tco}[1]{\texttt{\detokenize{#1}}} % for code in tabular environment
% \tco{} will break at spaces but not at underscores
\newcommand{\nf}[1]{\textnormal{#1}} % to return to normal font
\newcommand{\qop}[1]{{\sffamily #1}} % QC operator such as H, T, S, etc.
\DeclareRobustCommand{\euler}{\ensuremath{\mathrm{e}}}
\DeclareRobustCommand{\O}[1]{\ensuremath{\mathcal{O}(#1)}}
\newcommand{\Power}[1]{POWER#1}
\newcommand{\GNUC}{GNU~C}
\newcommand{\GCC}{GCC}
%\newcommand{\GCC}{\co{gcc}} % For those who prefer "gcc"
\newcommand{\IRQ}{IRQ}
%\newcommand{\IRQ}{irq} % For those who prefer "irq"
\newcommand{\mytexttrademark}{}
\newcommand{\mytextregistered}{}
%\newcommand{\mytexttrademark}{\textsuperscript\texttrademark}
%\newcommand{\mytextregistered}{\textsuperscript\textregistered}
\newcommand{\Epigraph}[2]{\epigraphhead[65]{\rmfamily\epigraph{#1}{#2}}}
\input{ushyphex} % Hyphenation exceptions for US English from hyphenex package
\input{pfhyphex} % Hyphenation exceptions for perfbook
\title{
Is Parallel Programming Hard, And, If So, \\
What Can You Do About It?}
\author{
Edited by: \\
\\
Paul E. McKenney \\
Linux Technology Center \\
IBM Beaverton \\
\href{mailto:paulmck@linux.vnet.ibm.com}{paulmck@linux.vnet.ibm.com} \\
} % end author
% \date{\ }
\input{autodate}
\setcounter{topnumber}{3}
\renewcommand\topfraction{.75}
\setcounter{bottomnumber}{2}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{5}
\renewcommand\textfraction{.15}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{3}
\renewcommand\dbltopfraction{.75}
\renewcommand\dblfloatpagefraction{.5}
\newlength{\twocolumnwidth}
\IfTwoColumn{
\setlength{\textheight}{8.25in}
\setlength{\textwidth}{6.5in}
\setlength{\columnsep}{0.25in}
\setlength{\twocolumnwidth}{\columnwidth}
\renewcommand\floatpagefraction{.75}
}{
\setlength{\textheight}{8.25in}
\setlength{\textwidth}{4.75in}
\setlength{\columnsep}{0in}
\setlength{\twocolumnwidth}{3.125in}
\addtolength{\oddsidemargin}{0.3in}
\addtolength{\evensidemargin}{-0.3in}
}
\IfHardCover{
\addtolength{\topmargin}{-0.25in}
\addtolength{\evensidemargin}{-0.25in}
}{}
\setcounter{secnumdepth}{3}
\frontmatter
\maketitle
\IfTwoColumn{
\onecolumn\begin{adjustwidth*}{.95in}{.8in}
\addtolength{\parindent}{6pt}
}{}
\input{legal}
\tableofcontents
\IfTwoColumn{
\end{adjustwidth*}\twocolumn
}{}
\mainmatter
\input{howto/howto}
\input{intro/intro}
\input{cpu/cpu}
\input{toolsoftrade/toolsoftrade}
\input{count/count.tex}
\input{SMPdesign/SMPdesign}
\input{locking/locking.tex}
\input{owned/owned.tex}
\input{defer/defer.tex}
\input{datastruct/datastruct.tex}
\input{debugging/debugging}
\input{formal/formal}
\input{together/together.tex}
\input{advsync/advsync.tex}
\input{memorder/memorder.tex}
\input{easy/easy.tex}
% \input{memalloc/memalloc.tex} @@@ covered in SMPdesign
\input{future/future.tex}
% @@@ Conclusion/summary or something, along with "use the right tool" cartoon.
\appendix
\input{appendix/appendix.tex}
% Index at some point...
% page-layout dimensions
% \cleardoublepage
% ~ \\
% paperheight: \the\paperheight \\
% paperwidth: \the\paperwidth \\
% topmargin: \the\topmargin \\
% headheight: \the\headheight \\
% headsep: \the\headsep \\
% textheight: \the\textheight \\
% textwidth: \the\textwidth \\
% oddsidemargin: \the\oddsidemargin \\
% evensidemargin: \the\evensidemargin \\
% footskip: \the\footskip \\
% topskip: \the\topskip \\
\end{document}