-
Notifications
You must be signed in to change notification settings - Fork 6
/
03-Concurrency.yaml
79 lines (66 loc) · 2.29 KB
/
03-Concurrency.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
course: 'CSCI 3431: Operating Systems'
qznumber: 3
qzdate: '10 November 2014'
qztitle: 'Concurrency'
instructions: |
Answer each of the following questions in complete sentences.
Take note of point values.
question:
- keywords: threads
points: 3
space: 0
text: |
For each, indicate whether the resource is private or shared amongst threads. \newline
\begin{table}[h]
\centering
\scalebox{1.0}{%
\begin{tabular}{|l|l|l|}
\hline
\textbf{Resource} & \textbf{Private} & \textbf{Shared} \\ \hline
Registers & & \\ \hline
Heap memory & & \\ \hline
Stack memory & & \\ \hline
Program counter & & \\ \hline
Static globals & & \\ \hline
Code section & & \\ \hline
\end{tabular}
}
\end{table}
- keywords: threads, locks
points: 2
space: 2
text: |
Explain what a \textbf{critical section} of code is?
- keywords: threads, locks
points: 3
space: 2
text: |
A function used by multiple threads has a simple counter shown below. \newline
Write the assembly-like instructions the code translates into. \newline
\texttt{counter = counter + 1;}
- keywords: threads, locks
points: 3
text: |
Explain why the above counter code is not atomic. \newline
How could you make it atomic?
- keywords: threads, locks
points: 3
space: 2
text: |
What are our three criteria for evaluating locks and other concurrent mechanisms? \newline
- keywords: threads, locks
points: 5
space: 4.5
text: |
Describe the x86 \texttt{xchg} instruction. \newline
How does it help us build a simple spin lock? \newline
- points: 1
space: 0
text: |
Please indicate which of the following is funniest: \newline
\emph{Some people, when confronted with a problem, think “I know, I’ll use multithreading”.} \newline
\emph{Nwo thye hvae two prblmsoe.}
\vspace{0.25in}
\emph{Multithreading jokes can be insensitive under certain race conditions} \newline
...