From 1d0b91c06e86ee62c52df8887d46fb02587f8fdf Mon Sep 17 00:00:00 2001 From: Ada Christiansen <60967674+luccaflower@users.noreply.github.com> Date: Wed, 17 Dec 2025 10:54:32 +0100 Subject: [PATCH] fix typo and formatting --- docs/computer-science/systems/ostep/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/computer-science/systems/ostep/index.md b/docs/computer-science/systems/ostep/index.md index afb9ac2..31ffd0e 100644 --- a/docs/computer-science/systems/ostep/index.md +++ b/docs/computer-science/systems/ostep/index.md @@ -187,7 +187,8 @@ As of December 2025 this project does not have any tests to verify your work, so 2. Lock - Create a race condition and verify that it actually triggers - Verify that the lock protects against the race condition -The thread implementation itself should be straightforward to verify as it can be done by simply setting some variables and comparing them after a join. The tricky part is the race condition. You might be tempted to recreate the multi-threaded loop-counting example from the book, however, it turns out that it can be very difficult to mkae that race condition trigger at all. We believe this is a quirk of running xv6 inside QEMU. + +The thread implementation itself should be straightforward to verify as it can be done by simply setting some variables and comparing them after a join. The tricky part is the race condition. You might be tempted to recreate the multi-threaded loop-counting example from the book, however, it turns out that it can be very difficult to make that race condition trigger at all. We believe this is a quirk of running xv6 inside QEMU. Instead, we recommend having a critical section of code that invokes multiple system calls. This guarantees interrupts, increasing the likelyhood of race conditions causing problems. A good candidate is printf. The xv6 implementation of printf invokes a write-syscall of a single byte for each printed character. Thus, if you use printf concurrently across multiple threads, there is a high chance that the terminal output gets garbled, unless you hold a working mutex lock for the duration of the printf-call.