Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions concurrency-primer.tex
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ \section{Atomicity}
\label{fig:atomicity}

Summary of concepts from the first three sections, as shown in \fig{fig:atomicity}.
In \secref{background}, we observe the importance of maintaining the correct order of operations: t3 \to t4 \to t5 \to t6 \to t7, so that two concurrent programs can function as expected.
In \secref{seqcst}, we see how two concurrent programs communicate to guarantee the order of operations: t5 \to t6.
In \secref{atomicity}, we understand that certain operations must be treated as a single atomic step to ensure the order of operations: t3 \to t4 \to t5 and the order of operations: t6 \to t7.
In \secref{background}, we observe the importance of maintaining the correct order of operations: $t3 \to t4 \to t5 \to t6 \to t7$, so that two concurrent programs can function as expected.
In \secref{seqcst}, we see how two concurrent programs communicate to guarantee the order of operations: $t5 \to t6$.
In \secref{atomicity}, we understand that certain operations must be treated as a single atomic step to ensure the order of operations: $t3 \to t4 \to t5$ and the order of operations: $t6 \to t7$.

\section{Arbitrarily-sized ``atomic'' types}
\label{atomictype}
Expand Down Expand Up @@ -397,7 +397,7 @@ \section{Read-modify-write}
This establishes correct order of operations from different threads.

\includegraphics[keepaspectratio, width=0.6\linewidth]{images/atomic-rmw}
\captionof{figure}{Exchange, Test and Set, Fetch and…, Compare and Swap can all be transformed into atomic RMW operations, ensuring that operations like t1 \to t2 \to t3 will become an atomic step.}
\captionof{figure}{Exchange, Test and Set, Fetch and…, Compare and Swap can all be transformed into atomic RMW operations, ensuring that operations like $t1 \to t2 \to t3$ will become an atomic step.}
\label{fig:atomic-rmw}

Atomic loads and stores are all well and good when we do not need to consider the previous state of atomic variables, but sometimes we need to read a value, modify it, and write it back as a single atomic step.
Expand Down Expand Up @@ -758,11 +758,11 @@ \subsection{SPMC solution - lock-based}

\textbf{state 1} : The producer is adding tasks to the job queue while multiple consumers wait for tasks to become available and is ready to take on any job that appears in the job queue.

\textbf{state 2} \to \textbf{state 3} : After the producer adds a task to the job queue,
\textbf{state 2} $\to$ \textbf{state 3} : After the producer adds a task to the job queue,
the producer releases the mutex lock, and then wake the consumers up.
Those consumers tried to acquire the lock of the job queue for the job before.

\textbf{state 3} \to \textbf{state 4} : Consumer 1 acquires the mutex lock for the job queue,
\textbf{state 3} $\to$ \textbf{state 4} : Consumer 1 acquires the mutex lock for the job queue,
retrieves a task from it, and then releases the mutex lock.

\textbf{state 5} : Next, other consumers attempt to acquire the mutex lock for the job queue.
Expand Down