Add lld-parking-lot module: thread-safe parking lot with Strategy, Observer and CAS-based spot claiming, 10 tests incl. 64-thread race

This commit is contained in:
2026-10-22 08:01:55 +00:00
parent d4b3a63615
commit a5fbf45971
24 changed files with 670 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Regenerates every transcript in output/. Needs JDK 21+ and Maven 3.9+.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p output
./scripts/run.sh > output/01-walkthrough.txt 2>&1
mvn -B -q test > /dev/null
python3 - <<'PY' > output/02-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("name"))
print(f"{total} tests, {fail} failures")
PY
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Compiles with plain javac (no Maven needed) and runs the walkthrough. Needs JDK 21 or newer.
set -euo pipefail
cd "$(dirname "$0")/.."
rm -rf target/plain && mkdir -p target/plain
javac -d target/plain $(find src/main/java -name '*.java')
java -cp target/plain com.ankurm.interviewlab.parking.Demo