>From 4ffdccdb87f3ae8663b3d9bda7bec4528e68c456 Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Wed, 22 Jan 2020 00:15:39 +0900 Subject: [PATCH 2/2] count: Move floats away from top of sections At the top of a few sections, there remain floats left over in commit e589003f0a1b ("Prevent section heading from orphaned"). This commit moves them. Fixes: e589003f0a1b ("Prevent section heading from orphaned") Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- count/count.tex | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/count/count.tex b/count/count.tex index 2b1bbff9..032f3a3c 100644 --- a/count/count.tex +++ b/count/count.tex @@ -161,12 +161,6 @@ are more appropriate for advanced students. % \epigraph{Seek simplicity, and distrust it.}{\emph{Alfred North Whitehead}} -\begin{listing}[tbp] -\input{CodeSamples/count/count_nonatomic@xxxxxxxxxxxx} -\caption{Just Count!} -\label{lst:count:Just Count!} -\end{listing} - Let's start with something simple, for example, the straightforward use of arithmetic shown in Listing~\ref{lst:count:Just Count!} (\path{count_nonatomic.c}). @@ -176,6 +170,12 @@ line~\lnref{inc}, and we read out its value on line~\lnref{read}. What could be simpler? \end{lineref} +\begin{listing}[tbp] +\input{CodeSamples/count/count_nonatomic@xxxxxxxxxxxx} +\caption{Just Count!} +\label{lst:count:Just Count!} +\end{listing} + This approach has the additional advantage of being blazingly fast if you are doing lots of reading and almost no incrementing, and on small systems, the performance is excellent. @@ -2260,6 +2260,12 @@ atomic operations are not necessary, as shown in the next section. \subsection{Signal-Theft Limit Counter Design} \label{sec:count:Signal-Theft Limit Counter Design} +Even though per-thread state will now be manipulated only by the +corresponding thread, there will still need to be synchronization +with the signal handlers. +This synchronization is provided by the state machine shown in +Figure~\ref{fig:count:Signal-Theft State Machine}. + \begin{figure}[tb] \centering \resizebox{2in}{!}{\includegraphics{count/sig-theft}} @@ -2267,11 +2273,6 @@ atomic operations are not necessary, as shown in the next section. \label{fig:count:Signal-Theft State Machine} \end{figure} -Even though per-thread state will now be manipulated only by the -corresponding thread, there will still need to be synchronization -with the signal handlers. -This synchronization is provided by the state machine shown in -Figure~\ref{fig:count:Signal-Theft State Machine}. The state machine starts out in the IDLE state, and when \co{add_count()} or \co{sub_count()} find that the combination of the local thread's count and the global count cannot accommodate the request, the corresponding @@ -2811,9 +2812,6 @@ Section~\ref{sec:count:Parallel Counting Lessons} enumerates lessons learned and calls attention to later chapters that will expand on these lessons. -\subsection{Parallel Counting Performance} -\label{sec:count:Parallel Counting Performance} - \begin{table*} \rowcolors{4}{}{lightgray} \renewcommand*{\arraystretch}{1.1} @@ -2859,6 +2857,9 @@ will expand on these lessons. \label{tab:count:Statistical/Limit Counter Performance on x86} \end{table*} +\subsection{Parallel Counting Performance} +\label{sec:count:Parallel Counting Performance} + The top half of \cref{tab:count:Statistical/Limit Counter Performance on x86} shows the performance of the four parallel statistical counting algorithms. -- 2.17.1