aboutsummaryrefslogtreecommitdiff
path: root/assignment3/assignment3.tex
diff options
context:
space:
mode:
authorCamil Staps2015-09-18 14:32:09 +0200
committerCamil Staps2015-09-18 14:32:09 +0200
commitf88b8232635eff4dafd923217de725fdf754d118 (patch)
tree8f30c749c5c08df96a720a34e3a5f1495f8470ff /assignment3/assignment3.tex
parentOrganisation; assignment 2 (diff)
Assignment 3
Diffstat (limited to 'assignment3/assignment3.tex')
-rw-r--r--assignment3/assignment3.tex45
1 files changed, 45 insertions, 0 deletions
diff --git a/assignment3/assignment3.tex b/assignment3/assignment3.tex
new file mode 100644
index 0000000..06070a4
--- /dev/null
+++ b/assignment3/assignment3.tex
@@ -0,0 +1,45 @@
+\documentclass[10pt,a4paper]{article}
+
+\usepackage[margin=2cm]{geometry}
+
+\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}}
+
+\usepackage{fancyhdr}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+\fancyhead{}
+\fancyfoot[C]{Copyright {\textcopyright} 2015 Camil Staps}
+\pagestyle{fancy}
+
+\usepackage{amsmath}
+\usepackage{amsfonts}
+
+\parindent0pt
+
+\title{Operating Systems - assignment 3}
+\author{Camil Staps\\\small{s4498062}}
+
+\begin{document}
+
+\maketitle
+\thispagestyle{fancy}
+
+\section*{5.16}
+Suppose two processes $p_1,p_2$ each call \texttt{semWait(s)} when $s=0$. Suppose further that $p_1$ executes until \texttt{semWaitB(delay)}, after which $p_2$ gains control and does the same. Both processes will set \texttt{mutex} to one, and both processes are placed in the delay queue when executing \texttt{semWaitB(delay)}. Unless there are other processes running simultaneously, these processes will never get a signal to stop waiting for \texttt{delay}.
+
+Swapping the lines \texttt{semSignalB(mutex)} and \texttt{semWaitB(delay)} would ensure that this doesn't happen.
+
+\section*{5.18}
+The passenger doesn't necessarily get out of the car he gets in to.
+
+For example, passengers $p_1,p_2$ may take cars $c_1,c_2$ respectively. Then suppose $c_2$ finishes driving around. It can happen that $p_1$ then continues walking around, while actually he got in to $c_1$.
+
+\end{document}
+