| \documentclass[10pt,twocolumn]{pfbook} % book class customized for perfbook |
| % For arxiv.org, must be on or before line 5: |
| \pdfoutput=1 |
| |
| % To accomodate change in Ghostscript 9.26 (default output: PDF 1.7) |
| \pdfminorversion=7 |
| |
| % Suppress warning emitted when multiple figures drawn by inkscape appear |
| % within a page. See: https://tex.stackexchange.com/questions/183149/ |
| \ifdefined\pdfsuppresswarningpagegroup \pdfsuppresswarningpagegroup=1 \fi |
| |
| % 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 |
| |
| % 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{examplep} |
| % \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{fancyvrb} |
| \usepackage[bottom]{footmisc} % place footnotes under floating figures/tables |
| \usepackage{tabularx} |
| \usepackage[hyphens]{url} |
| \usepackage{threeparttable} |
| \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} |
| \usepackage{noindentafter} |
| \NoIndentAfterCmd{\epigraph} |
| |
| % 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}} |
| \newboolean{nimbusavail} |
| \setboolean{nimbusavail}{false} |
| \newcommand{\IfNimbusAvail}[2]{\ifthenelse{\boolean{nimbusavail}}{#1}{#2}} |
| |
| \IfNimbusAvail{ |
| \usepackage{nimbusmononarrow} |
| }{} |
| \renewcommand*\ttdefault{lmtt} |
| %msfontstub |
| |
| \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 |
| |
| \fvset{fontsize=\scriptsize,obeytabs=true} |
| \IfTwoColumn{ |
| \fvset{tabsize=2} |
| }{ |
| \fvset{tabsize=8} |
| } |
| \DefineVerbatimEnvironment{VerbatimL}{Verbatim}% |
| {numbers=left,numbersep=5pt,xleftmargin=9pt} |
| \AfterEndEnvironment{VerbatimL}{\vspace*{-9pt}} |
| \DefineVerbatimEnvironment{VerbatimN}{Verbatim}% |
| {numbers=left,numbersep=3pt,xleftmargin=5pt,xrightmargin=5pt,frame=single} |
| \DefineVerbatimEnvironment{VerbatimU}{Verbatim}% |
| {numbers=none,xleftmargin=5pt,xrightmargin=5pt,samepage=true,frame=single} |
| |
| \IfLmttForCode{ |
| \AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}} |
| \AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{lmtt}} |
| \AtBeginEnvironment{table}{\renewcommand{\ttdefault}{lmtt}} |
| \AtBeginEnvironment{table*}{\renewcommand{\ttdefault}{lmtt}} |
| \AtBeginEnvironment{sidewaystable*}{\renewcommand{\ttdefault}{lmtt}} |
| \AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{lmtt}} |
| \AtBeginEnvironment{listing}{\renewcommand{\ttdefault}{lmtt}} |
| \fvset{fontfamily=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 |
| \newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}} |
| \newcommand{\nbco}[1]{\mbox{\PVerb[pverb-space=invnobreak]{#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{\lopt}[1]{\tco{-}\tco{-}\tco{#1}} % to avoid "--" to endash conversion |
| \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{\rt}{\mbox{-rt}} % to prevent line break behind "-" |
| \newcommand{\mytexttrademark}{} |
| \newcommand{\mytextregistered}{} |
| %\newcommand{\mytexttrademark}{\textsuperscript\texttrademark} |
| %\newcommand{\mytextregistered}{\textsuperscript\textregistered} |
| |
| \newcommand{\Epigraph}[2]{\epigraphhead[65]{\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} |
| %\fvset{fontsize=\scriptsize,numbers=left,numbersep=5pt,xleftmargin=9pt,obeytabs=true,tabsize=2} |
| \newcommand{\lnlblbase}{} |
| \newcommand{\lnlbl}[1]{\phantomsection\label{\lnlblbase:#1}} |
| \newlength{\lnlblraise} |
| \setlength{\lnlblraise}{6pt} |
| \AtBeginEnvironment{VerbatimN}{% |
| \renewcommand{\lnlbl}[1]{% |
| \raisebox{\lnlblraise}{\phantomsection\label{\lnlblbase:#1}}}% |
| } |
| \newcommand{\lnrefbase}{} |
| \newcommand{\lnref}[1]{\ref{\lnrefbase:#1}} |
| |
| \newenvironment{linelabel}[1][]{\renewcommand{\lnlblbase}{#1}% |
| \ignorespaces}{\ignorespacesafterend} |
| \newenvironment{lineref}[1][]{\renewcommand{\lnrefbase}{#1}% |
| \ignorespaces}{\ignorespacesafterend} |
| |
| \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} |