From f88b8232635eff4dafd923217de725fdf754d118 Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Fri, 18 Sep 2015 14:32:09 +0200
Subject: Assignment 3

---
 assignment3/assignment3.tex | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 assignment3/assignment3.tex

(limited to 'assignment3/assignment3.tex')

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}
+
-- 
cgit v1.2.3

