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
+14
View File
@@ -0,0 +1,14 @@
== NAIVE ==
findDeadlockedThreads: DEADLOCK
transfer-A-to-B is WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync owned by transfer-B-to-A
transfer-B-to-A is WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync owned by transfer-A-to-B
after interrupting both threads: total balance = 2000
== ORDERED ==
both transfers completed, no deadlock to detect
balances A=930 B=1070
== TRY_LOCK ==
both transfers completed, no deadlock to detect
balances A=930 B=1070 retries>0=true
== NAIVE on virtual threads ==
thread states: [WAITING, WAITING]
findDeadlockedThreads: none (virtual threads are invisible to it)