Add multilingual language and systems learning tracks
This commit is contained in:
1 parent
07338189fc
commit
d8d1c40118
844 files changed
+6061
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# Concurrency & Scheduling · 1
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=27&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: An interleaving can lose an update](lesson-1/lesson.html)
|
||||
- [Lesson 2: Lock scope and ownership](lesson-2/lesson.html)
|
||||
- [Lesson 3: Bounded queues and backpressure](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,7 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>An interleaving can lose an update</title><h1>An interleaving can lose an update</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Two workers can read the same counter before either writes. Both compute one, and the final value becomes one instead of two. The deterministic example models the interleaving without relying on a race to happen by chance. Identify the shared state and the operation that must be atomic or protected.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">counter=0
|
||||
a=counter
|
||||
b=counter
|
||||
counter=a+1
|
||||
counter=b+1
|
||||
print(counter)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>1</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
counter=0
|
||||
a=counter
|
||||
b=counter
|
||||
counter=a+1
|
||||
counter=b+1
|
||||
print(counter)
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Lock scope and ownership</title><h1>Lock scope and ownership</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A lock protects an invariant only when every relevant access follows the same rule. Protect the whole read-modify-write operation, not just the final assignment. Define a consistent lock order when multiple locks are needed. A global lock may be correct but limit throughput; measure before splitting it.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Bounded queues and backpressure</title><h1>Bounded queues and backpressure</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>An unbounded producer can exhaust memory when consumers are slower. Choose a bounded queue and a policy: wait, reject, or shed selected work. Cancellation and shutdown must wake blocked participants. Model a capacity of two, then explain what happens to a third job and how the caller learns the outcome.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">queue=[]
|
||||
capacity=2
|
||||
for job in ["A","B","C"]:
|
||||
if len(queue)<capacity:queue.append(job)
|
||||
else:print("Rejected",job)
|
||||
print(queue)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Rejected C
|
||||
['A', 'B']</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
queue=[]
|
||||
capacity=2
|
||||
for job in ["A","B","C"]:
|
||||
if len(queue)<capacity:queue.append(job)
|
||||
else:print("Rejected",job)
|
||||
print(queue)
|
||||
Reference in new issue
Block a user