Add multithreading module: odd-even, ping-pong, ordered threads, deadlock detection and fixes, virtual-thread variants (25 tests)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
This commit is contained in:
Claude
2026-10-28 18:10:23 +00:00
parent f80e1079a8
commit 94306c50ab
29 changed files with 1021 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Regenerates every transcript in output/. Needs JDK 25 and Maven 3.9+.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p output
./scripts/run.sh odd-even > output/01-odd-even.txt
./scripts/run.sh ping-pong > output/02-ping-pong.txt
./scripts/run.sh ordered > output/03-ordered-threads.txt
./scripts/run.sh deadlock > output/04-deadlock.txt
./scripts/run.sh virtual > output/05-virtual-single-carrier.txt
mvn -B -q test > /dev/null 2>&1
python3 - <<'PY' > output/06-test-results.txt
import glob, xml.etree.ElementTree as ET
total = fail = 0
for f in sorted(glob.glob("target/surefire-reports/TEST-*.xml")):
for tc in ET.parse(f).getroot().iter("testcase"):
bad = tc.find("failure") is not None or tc.find("error") is not None
total += 1; fail += bad
print(("FAIL " if bad else "PASS ") + tc.get("classname").split(".")[-1] + "." + tc.get("name"))
print(f"{total} tests, {fail} failures")
PY