\begin{frame} \frametitle{Example} \begin{quiz}{\textwidth}{} \begin{tcenter} {\small\def\scheduleWidth{1cm} \begin{tikzpicture} \schedule{}{3}{1rV|2rY|3wV|1rZ|2wV|1rY|3wZ} \end{tikzpicture} } \end{tcenter} \begin{itemize} \item Can it be achieved using 2 PL?\\ \item Can it be achieved using Strict 2 PL? \end{itemize} Add the corresponding lock and unlock statements. \medskip\pause \hspace*{-.2cm}% \scalebox{.85}{ {\footnotesize\def\scheduleWidth{.68cm}\def\scheduleOffset{.5cm} \begin{tikzpicture} \only<-2>{ \schedule{}{3}{1sV|1rV|2sY|2rY|3xV|3wV|1sZ|1rZ|2xV|2wV|1sY|1rY|3xZ|3wZ} } \only<3-4>{ \schedule{}{3}{1SV|1rV|2sY|2rY|3XV|3wV|1sZ|1rZ|2xV|2wV|1sY|1rY|3xZ|3wZ} } \only<5>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|2xV|2wV|1rY|3xZ|3wZ} } \only<5->{ \node at (2*\scheduleWidth - .2cm,-.5*\scheduleHeight) {\tshared{V\alert<10>{Z}Y}}; } \only<6>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3XV|3wV|1rZ|2XV|2wV|1rY|3xZ|3wZ} } \only<7>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|3uV|2xV|2wV|1rY|3xZ|3wZ} } \only<8>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|3UV|2xV|2wV|1rY|3XZ|3wZ} } \only<9>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|3xZ|3uV|2xV|2wV|1rY|3wZ} } \only<10>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|3XZ|3uV|2xV|2wV|1rY|3wZ} } \only<11>{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|1uZ|3xZ|3uV|2xV|2wV|1rY|3wZ} } \only<12->{ \schedule{}{3}{1_ |1_ |1rV|1uV|2sY|2rY|3xV|3wV|1rZ|1uZ|3xZ|3uV|2xV|2wV|1rY|3wZ|1uY|1_ } } \only<12->{ \node at (18*\scheduleWidth,-1.5*\scheduleHeight) {\tunlock{VY}}; \node at (18*\scheduleWidth,-2.5*\scheduleHeight) {\tunlock{Z}}; } \end{tikzpicture} }}% \medskip \onslide<4->{\alert{Impossible with Strict 2 PL: $T_1$ must hold lock on $V$ until commit.}}% \pause[13]% \smallskip This schedule is 2 PL ! \smallskip\pause Can it be achieved using Preclaiming 2 PL? \pause No \end{quiz} \end{frame}