Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hongmingjian committed May 16, 2018
1 parent 8930ad7 commit d2da314
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
23 changes: 11 additions & 12 deletions deadlock/deadlock.tex
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ \subsection{Deadlock avoidance}
\begin{frame}
\frametitle{Safe state (1/2)} \pause
\begin{itemize}
\item{When a process requests an available resource, system must decide if immediate allocation leaves the system in a \emph{safe state}.} \pause
\item{Definition} \pause
\begin{itemize}
\item{System is in safe state if there exists a safe sequence of all processes $<P_0, P_1, ..., P_n>$ such that for each $P_i$, the resources that $P_i$ can still request can be satisfied by currently available resources plus resources held by all the $P_j$, with $j<i$.} \pause
\end{itemize}
Expand All @@ -329,18 +329,14 @@ \subsection{Deadlock avoidance}
\item{If a system is in safe state, no deadlocks;} \pause
\item{If a system is in unsafe state, possibility of deadlock.} \pause
\end{itemize}
\item{Deadlock avoidance must ensure that a system will never enter an unsafe state.}
\item{Deadlock avoidance must ensure that a system will never enter an unsafe state.} \pause
\end{itemize}
\end{frame}

%% PAGE
\begin{frame}
\frametitle{Safe state (2/2)} \pause
\begin{center}
\includegraphics[scale=0.5]{v6f8-4}
\includegraphics[scale=0.2]{v6f8-4}
\end{center}
\end{frame}


%% PAGE
\begin{frame}
\frametitle{Banker's algorithm} \pause
Expand All @@ -350,7 +346,13 @@ \subsection{Deadlock avoidance}
\item{It's invented by Dijkstra in 1968 and used on the \textbf{THE} operating system.} \pause
\item{It can be used in a banking system to ensure that the bank never allocates its available cash such that it can no longer satisfy the needs of all its customers.} \pause
\end{itemize}
\item{It requires that a new process must declare the maximum number of instances of each resource type that it may need.}
\item{It requires that a new process must declare the maximum number of instances of each resource type that it may need.} \pause
\item{This algorithm requires an order of $m \times n^2$ operations for safety detection.} \pause
\begin{itemize}
\item{m: The number of resource types} \pause
\item{n: The number of processes}
\end{itemize}

\end{itemize}
\end{frame}

Expand Down Expand Up @@ -389,9 +391,6 @@ \subsection{Deadlock avoidance}
\item{$Work = Work + Allocation_i$; $Finish[i] = true$; \newline go to step 2.} \pause
\item{If $Finish[i] = true$ for all $i$, then the system is in a safe state.} \pause
\end{enumerate}
\begin{itemize}
\item{This algorithm requires an order of $m \times n^2$ operations for safety detection.}
\end{itemize}
\end{frame}

%% PAGE
Expand Down
8 changes: 6 additions & 2 deletions fs/fs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
\begin{itemize}\parskip=0pt
\item Because many CPUs supply bit-manipulation instructions \pause
\end{itemize}
\item Easy to get contiguous blocks
\item Easy to get contiguous blocks \pause
\item Bit vector must be kept in the memory to be efficient and in the disk to be persistent \pause
\begin{itemize}\parskip=0pt
\item Assume block size = $2^{12}$ bytes and disk size = $2^{30}$ bytes (1 gigabyte), then \emph{n}=$2^{30}/2^{12}=2^{18}$ (32K bytes)
Expand Down Expand Up @@ -876,6 +876,8 @@
\end{center}
\end{frame}

\iffalse

\subsection{Efficiency and performance}

%% PAGE
Expand Down Expand Up @@ -937,7 +939,9 @@
\includegraphics[scale=.5]{question}
\end{center}
\end{frame}


\fi

%% PAGE
\end{CJK*}
\end{document}

0 comments on commit d2da314

Please sign in to comment.