diff options
Diffstat (limited to 'ws2015/oss')
-rw-r--r-- | ws2015/oss/blaetter/07/abgabe.md | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/ws2015/oss/blaetter/07/abgabe.md b/ws2015/oss/blaetter/07/abgabe.md index 833756d..b136b1a 100644 --- a/ws2015/oss/blaetter/07/abgabe.md +++ b/ws2015/oss/blaetter/07/abgabe.md | |||
@@ -7,13 +7,13 @@ header-includes: | |||
7 | a) | 7 | a) |
8 | 8 | ||
9 | \begin{tikzpicture} | 9 | \begin{tikzpicture} |
10 | \draw[thick, <->] (0, 6) -- (0, 0) -- (10, 0); | 10 | \draw[thick, <->] (0, 6) -- (0, 0) -- (9.5, 0); |
11 | \foreach \x in {1, 2, 3, 4, 5} | 11 | \foreach \x in {1, 2, 3, 4, 5} |
12 | \draw[thick] (-1pt, \x) -- (1pt, \x) node [anchor=east] {$P_{\x}$}; | 12 | \draw[thick] (-1pt, \x) -- (1pt, \x) node [anchor=east] {$P_{\x}$}; |
13 | \foreach \x in {0, ..., 19} | 13 | \foreach \x in {0, ..., 18} |
14 | \draw[thick] ({\x / 2}, -1pt) -- ({\x / 2}, 1pt) node [anchor=north] {$\x$}; | 14 | \draw[thick] ({\x / 2}, -1pt) -- ({\x / 2}, 1pt) node [anchor=north] {$\x$}; |
15 | 15 | ||
16 | \draw[xstep=0.5, ystep=1, gray, very thin] (0, 5) grid (9.5, 0); | 16 | \draw[xstep=0.5, ystep=1, gray, very thin] (0, 5) grid (9, 0); |
17 | 17 | ||
18 | \draw[|-|] (0, 1) -- (1, 1); | 18 | \draw[|-|] (0, 1) -- (1, 1); |
19 | 19 | ||
@@ -26,26 +26,26 @@ a) | |||
26 | \draw[|-|] (6.5, 4) -- (8, 4); | 26 | \draw[|-|] (6.5, 4) -- (8, 4); |
27 | 27 | ||
28 | \draw[|-|, dashed] (2.5, 5) -- (8, 5); | 28 | \draw[|-|, dashed] (2.5, 5) -- (8, 5); |
29 | \draw[|-|] (8, 5) -- (9.5, 5); | 29 | \draw[|-|] (8, 5) -- (9, 5); |
30 | \end{tikzpicture} | 30 | \end{tikzpicture} |
31 | 31 | ||
32 | b) | 32 | b) |
33 | 33 | ||
34 | \begin{tikzpicture} | 34 | \begin{tikzpicture} |
35 | \draw[thick, <->] (0, 6) -- (0, 0) -- (10, 0); | 35 | \draw[thick, <->] (0, 6) -- (0, 0) -- (9.5, 0); |
36 | \foreach \x in {1, 2, 3, 4, 5} | 36 | \foreach \x in {1, 2, 3, 4, 5} |
37 | \draw[thick] (-1pt, \x) -- (1pt, \x) node [anchor=east] {$P_{\x}$}; | 37 | \draw[thick] (-1pt, \x) -- (1pt, \x) node [anchor=east] {$P_{\x}$}; |
38 | \foreach \x in {0, ..., 19} | 38 | \foreach \x in {0, ..., 18} |
39 | \draw[thick] ({\x / 2}, -1pt) -- ({\x / 2}, 1pt) node [anchor=north] {$\x$}; | 39 | \draw[thick] ({\x / 2}, -1pt) -- ({\x / 2}, 1pt) node [anchor=north] {$\x$}; |
40 | 40 | ||
41 | \draw[xstep=0.5, ystep=1, gray, very thin] (0, 5) grid (9.5, 0); | 41 | \draw[xstep=0.5, ystep=1, gray, very thin] (0, 5) grid (9, 0); |
42 | 42 | ||
43 | \draw[|-|] (0, 1) -- (1, 1); | 43 | \draw[|-|] (0, 1) -- (1, 1); |
44 | 44 | ||
45 | \draw[|-|] (1, 2) -- (3, 2); | 45 | \draw[|-|] (1, 2) -- (3, 2); |
46 | 46 | ||
47 | \draw[|-|, dashed] (1, 3) -- (5.5, 3); | 47 | \draw[|-|, dashed] (1, 3) -- (5.5, 3); |
48 | \draw[|-|] (5.5, 3) -- (9.5, 3); | 48 | \draw[|-|] (5.5, 3) -- (9, 3); |
49 | 49 | ||
50 | \draw[|-|, dashed] (2, 4) -- (4, 4); | 50 | \draw[|-|, dashed] (2, 4) -- (4, 4); |
51 | \draw[|-|] (4, 4) -- (5.5, 4); | 51 | \draw[|-|] (4, 4) -- (5.5, 4); |
@@ -54,5 +54,22 @@ b) | |||
54 | \draw[|-|] (3, 5) -- (4, 5); | 54 | \draw[|-|] (3, 5) -- (4, 5); |
55 | \end{tikzpicture} | 55 | \end{tikzpicture} |
56 | 56 | ||
57 | c) | 57 | c) Es seien $W(P_n)$, $V(P_n)$, $W^\prime(P_n)$, und $V^\prime(P_n)$ die Wartezeit und die Verweilzeit des Prozesses $P_n$ für FCFS und SJF. |
58 | 58 | ||
59 | \begin{align*} | ||
60 | \frac{\sum_{i = 1}^n W(P_n)}{5} &= \frac{0 + 0 + 4 + 9 + 11}{5} = \frac{24}{5} = 4.8 \\ | ||
61 | \frac{\sum_{i = 1}^n V(P_n)}{5} &= \frac{2 + 4 + 11 + 12 + 14}{5} = \frac{43}{5} = 8.6 | ||
62 | \\ | ||
63 | \frac{\sum_{i = 1}^n W^\prime(P_n)}{5} &= \frac{0 + 0 + 9 + 4 + 1}{5} = \frac{14}{5} = 2.8 \\ | ||
64 | \frac{\sum_{i = 1}^n V^\prime(P_n)}{5} &= \frac{2 + 4 + 16 + 7 + 3}{5} = \frac{35}{5} = 7 | ||
65 | \end{align*} | ||
66 | |||
67 | d) Prozesse, die, laut Scheduler, lange Bedienzeiten haben verweilen sehr lange, da sie lange warten. | ||
68 | |||
69 | # Prozesse und Threads | ||
70 | |||
71 | a) running | ||
72 | b) *ein Prozess, kein Thread* wird als equivalent gesehen zu *kein Prozess* | ||
73 | c) Threads teilen sich innerhalb eines Prozesses einen Adressraum, Daten sind nicht *sicher*. | ||
74 | d) suspended | ||
75 | e) Zuordnung mehrer Treads eines Prozesses auf verschiedene Prozessoren | ||