diff options
author | Camil Staps | 2015-09-25 20:26:42 +0200 |
---|---|---|
committer | Camil Staps | 2015-09-25 20:26:42 +0200 |
commit | 9553a1e1fe7193ad6427a669da802db6927a041e (patch) | |
tree | 8fd649047ecf33e1d881e27e8d54fe93b0aa3ebe | |
parent | Start assignment 4 (diff) |
Finish assignment 4
-rw-r--r-- | assignment4/assignment4.tex | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/assignment4/assignment4.tex b/assignment4/assignment4.tex index e31b35e..1d20051 100644 --- a/assignment4/assignment4.tex +++ b/assignment4/assignment4.tex @@ -4,9 +4,6 @@ \usepackage{minted} -\usepackage{enumitem} -\setenumerate[1]{label=\alph*.} - % textcomp package is not available everywhere, and we only need the Copyright symbol % taken from http://tex.stackexchange.com/a/1677/23992 \DeclareTextCommandDefault{\textregistered}{\textcircled{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}} @@ -20,9 +17,9 @@ \usepackage{amsmath} \usepackage{amsfonts} +\usepackage{mathtools} \usepackage{enumitem} -\setenumerate[1]{label=\alph*.} \parindent0pt @@ -35,10 +32,22 @@ \thispagestyle{fancy} \section*{6.11} -%todo +\begin{enumerate} + \item No process is marked, because no process has all zeros in the allocation matrix. + \item $W \coloneqq (2,1,1,2)$. + \item Take $i=1$. + \item Mark $P_1$, $W \coloneqq (2,1,2,2)$. + \setcounter{enumi}{2} + \item Take $i=3$. + \item Mark $P_3$, $W \coloneqq (2,2,3,2)$. + \setcounter{enumi}{2} + \item Both $Q_2 > W$ and $Q_4 > W$, so we terminate. +\end{enumerate} + +There are unmarked processes ($P_2,P_4$), therefore, deadlock exists, for exactly those processes. \section*{6.18} -\begin{enumerate} +\begin{enumerate}[label=\alph*.] \item If there are two types of philosophers, the fourth condition of deadlock (circular wait) is not fulfilled. Lefties and righties can never be in a chain waiting for resources. Therefore, deadlock cannot occur. \item On a table with two philosophers, of which one is a lefty and one a righty, it is obvious to see that one philosopher will start eating and when he is done, the other one can grab the forks. No starvation occurs. |