From: bdemsky Date: Mon, 11 Jul 2016 21:58:30 +0000 (-0700) Subject: edits X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=commitdiff_plain;h=be809ac28e1f70e3c27b05e68d452bb1f5ea8a43 edits --- diff --git a/doc/iotcloud.tex b/doc/iotcloud.tex index 78fee74..3c33012 100644 --- a/doc/iotcloud.tex +++ b/doc/iotcloud.tex @@ -127,37 +127,34 @@ Client can make a request to resize the queue. This is done as a write that comb \subsection{Server Algorithm} $s \in SN$ is a sequence number\\ $sv \in SV$ is a slot's value\\ -$slot_s = \tuple{s, sv} \in Q \subseteq SN \times SV$ \\ +$slot_s = \tuple{s, sv} \in SL \subseteq SN \times SV$ \\ \textbf{State} \\ -\textit{Q = set of live slots on server} \\ +\textit{SL = set of live slots on server} \\ \textit{max = maximum number of slots (input only for resize message)} \\ \textit{n = number of slots} \\ \begin{algorithmic}[1] -\Function{GetSlot}{$s'$} -\State \Return{$\{\tuple{s, sv} \in Q \mid s \geq s'\}$} +\Function{GetSlot}{$s_g$} +\State \Return{$\{\tuple{s, sv} \in SL \mid s \geq s_g\}$} \EndFunction \end{algorithmic} \begin{algorithmic}[1] \Function{PutSlot}{$s',sv',max'$} -\If{$(max' \neq \emptyset) \land (max' > max)$}\Comment{Resize} - \State $Q' \gets new\:queue\:of\:\langle s,sv \rangle\:with - \:size\:max'$ - \State $Q \gets Q' \cup Q$ - \State $max \gets max'$ +\If{$(max' \neq \emptyset)$}\Comment{Resize} +\State $max \gets max'$ \EndIf \If{$(s' = s_n + d)$} \If{$n = max$} - \State $Q \gets Q - \{\langle s_n,sv_n \rangle\}$ + \State $SL \gets SL - \{\langle s_n,sv_n \rangle\}$ \Else \Comment{$n < max$} \State $n \gets n + 1$ \EndIf - \State $Q \gets Q \cup \{\langle s',sv' \rangle\}$ + \State $SL \gets SL \cup \{\langle s',sv' \rangle\}$ \State \Return{$true$} \Else - \State \Return{$(false,\{\langle i,sv_i \rangle \in Q \mid + \State \Return{$(false,\{\langle i,sv_i \rangle \in SL \mid s' \leq i \leq s_n\})\$} \EndIf \EndFunction