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,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)
|
||||
Reference in new issue
Block a user