Skip to content

Commit

Permalink
Added SC animation, small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fresheed committed Sep 24, 2021
1 parent e3e7351 commit a4d3eac
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion defs.tex
Expand Up @@ -276,7 +276,7 @@
fr/.style={->,color=colorFR,dotted,thick,shorten >=-0.5mm,shorten <=-0.5mm},
deps/.style={->,color=colorDEPS,dotted,thick,shorten >=-0.5mm,shorten <=-0.5mm},
rmw/.style={->,color=colorRMW,thick,shorten >=-0.5mm,shorten <=-0.5mm},
mem/.style={to-to,color=colorPO,thin,shorten >=-0.5mm,shorten <=-0.5mm},
mem/.style={-to,color=colorPO,thick},
time/.style={-to,dashed,color=colorPO,thick},
frComp/.style={->,color=colorFR,line width=3,opacity=0.5},
thicc/.style={->,color=gray,thick,line width=5,opacity=1},
Expand Down
4 changes: 4 additions & 0 deletions programs_iteration.tex
Expand Up @@ -25,6 +25,10 @@
\newcommand{\selectII}{
\renewcommand{\tIcolor}{\passiveColor} \renewcommand{\tIIcolor}{\activeColor}
}
\newcommand{\unselect}{
\renewcommand{\tIcolor}{\passiveColor} \renewcommand{\tIIcolor}{\passiveColor}
}

\newcommand{\upd}[2]{\renewcommand{#1}{#2}}
\newcommand{\spinlockClientIIExpandedIter}{
\begin{figure}[h]
Expand Down
9 changes: 9 additions & 0 deletions setup.tex
Expand Up @@ -16,8 +16,17 @@
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\hspace{1em}%
\ifnum \theframenumber=1
% This is the title frame, do nothing

\else
% These would be all the following frames
% <<<Your template code goes here>>>
{\large \insertframenumber/\inserttotalframenumber}
\fi
}



\usepackage{textpos}
\usepackage{graphicx}
Expand Down
7 changes: 6 additions & 1 deletion systems.tex
Expand Up @@ -2,11 +2,16 @@
\node[rectangle, draw = none, fill = #6,minimum width = #4,minimum height = #5]
(#1) at #2 {#3}
}
\newcommand{\myrectBorder}[6]{ % node name, position, text, width, height, color
\node[rectangle, draw = #6, fill = none,minimum width = #4,minimum height = #5]
(#1) at #2 {#3}
}
\newcommand{\myrectMulti}[6]{ % node name, position, text, width, height, color
\node[rectangle, draw = none, fill = #6,minimum height = #5,text width=#4,draw=blue]
(#1) at #2 {#3}
}


% \newcommand{\memPos}{O}
\newcommand{\scSystem}{
\begin{tikzpicture}[xscale=1, yscale=1]
\myrect{T1}{(0, 0)}{Thread 1}{1cm}{0.5cm}{green};
Expand Down
18 changes: 15 additions & 3 deletions terminates_sc.tex
Expand Up @@ -25,7 +25,7 @@

% \begin{frame}{Spinlock terminates under sequential consistency \onslide<4->{[Lamport 1979], \ \ \ but now we use other semantics:}}
\begin{frame}{Spinlock terminates under interleaving semantics}

\unselect
\only<4->{\selectI \upd{\progPosI}{I}}
\only<5->{\upd{\progPosI}{II}}
\only<6->{\selectII \upd{\progPosII}{I}}
Expand All @@ -44,9 +44,21 @@
\spinlockClientIIExpandedIter
\end{column}

\begin{column}{0.5\linewidth}
\begin{column}{0.55\linewidth}
\only<2->{
\scSystem
% \scSystem
\begin{tikzpicture}[xscale=1, yscale=1]
\myrect{T1}{(0, 0)}{Thread 1}{1cm}{0.5cm}{\tIcolor!50};
\myrect{T2}{(3, 0)}{Thread 2}{1cm}{0.5cm}{\tIIcolor!50};
\node (T1b) at (0, -2) {}; \node (T2b) at (3, -2) {};

\myrectBorder{Mem}{(1.5, -2)}{\large{$l \leftarrow \only<-4,10-11,13->{0}\only<5-9,12>{1}$}}{5cm}{0.5cm}{black};

\draw[mem,transform canvas={xshift=0.3cm,yshift=0.1cm}] (T1) edge (T1b);
\draw[mem,transform canvas={xshift=-0.3cm,yshift=0.1cm}] (T1b) edge (T1);
\draw[mem,transform canvas={xshift=0.3cm,yshift=0.1cm}] (T2) edge (T2b);
\draw[mem,transform canvas={xshift=-0.3cm,yshift=0.1cm}] (T2b) edge (T2);
\end{tikzpicture}
}
\end{column}

Expand Down

0 comments on commit a4d3eac

Please sign in to comment.