Add hashmap-vs-concurrenthashmap module: JDK 25 sizeCtl/treeify internals, forced and measured lost updates
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates every file in output/. Needs JDK 25 and Maven. First run must be online.
|
||||
# 01-04, 06-08 are written by JUnit tests that assert the same numbers (deterministic).
|
||||
# 05 is a MEASUREMENT (lost updates differ on every run) and is not asserted by any test.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
mkdir -p output
|
||||
mvn -B -q test
|
||||
mvn -B -q compile
|
||||
{ java -Xmx512m \
|
||||
--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED \
|
||||
-cp target/classes com.ankurm.interviewlab.hashmapvschm.LostUpdateDemo 2>&1 \
|
||||
| grep -v '^Picked up JAVA_TOOL_OPTIONS' ; } > output/05-measured-lost-updates.txt
|
||||
# The first line of 05 names the machine's core count; the rest varies run to run by design.
|
||||
echo "done:"; ls -1 output
|
||||
Reference in New Issue
Block a user