Skip to content
Snippets Groups Projects
Commit bed881fc authored by Chao Zhan's avatar Chao Zhan
Browse files

update slides, add bankers algorithms

parent f6887a86
Branches
No related tags found
No related merge requests found
...@@ -51,3 +51,58 @@ layout: two-cols ...@@ -51,3 +51,58 @@ layout: two-cols
<!-- <img src="/images/RPC.webp" class="block w-md"/> --> <!-- <img src="/images/RPC.webp" class="block w-md"/> -->
<!-- </div> --> <!-- </div> -->
---
title: Banker's Algorithm
---
## Banker's Algorithm I
Calculate $v$ and $B$ and give an termination order of the threads if the situation is safe.
<br />
$$
G = \begin{pmatrix}
5 & 3 & 3 & 1 \\
4 & 3 & 1 & 3 \\
5 & 6 & 4 & 3 \\
2 & 2 & 0 & 0 \\
6 & 5 & 3 & 2
\end{pmatrix}
R = \begin{pmatrix}
4 & 3 & 2 & 1 \\
1 & 2 & 0 & 1 \\
4 & 5 & 3 & 2 \\
0 & 1 & 0 & 0 \\
5 & 3 & 1 & 1
\end{pmatrix}
f = \begin{pmatrix} 0 & 1 & 0 & 1 \end{pmatrix}
$$
---
title: Banker's Algorithm
---
## Banker's Algorithm II
Calculate $f$ and $R$ and give an termination order of the threads if the following situation is safe.
<br />
$$
G = \begin{pmatrix}
5 & 11 & 10 \\
8 & 6 & 11 \\
7 & 3 & 5 \\
\end{pmatrix}
B = \begin{pmatrix}
3 & 10 & 9 \\
6 & 4 & 7 \\
2 & 0 & 4 \\
\end{pmatrix}
v = \begin{pmatrix} 13 & 15 & 22 \end{pmatrix}
$$
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment