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:
@@ -0,0 +1,9 @@
|
||||
Two threads, two increments, forced interleaving: read, read, write, write
|
||||
==========================================================================
|
||||
|
||||
expected final value: 2
|
||||
HashMap get + put: 1
|
||||
synchronizedMap get + put: 1
|
||||
ConcurrentHashMap get + put: 1
|
||||
ConcurrentHashMap merge: 2
|
||||
(each map call is individually thread-safe; the get-then-put PAIR is not atomic)
|
||||
Reference in New Issue
Block a user