blob: 32f0e6d5ef28c0bf629bc1bff109452606cc53a0 [file] [log] [blame]
\documentclass[10pt,twocolumn]{book}
% 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}
% \usepackage{breakurl}
\usepackage{graphicx}
\usepackage{rotating}
\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}
% 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
}
\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}