1. What a pinned carrier changes
A virtual thread runs on a platform thread called a carrier. During a supported blocking operation the virtual thread can unmount, leaving that carrier free to run other work. On Java 21, blocking while holding a Java monitor can keep the carrier occupied. Both synchronized and ReentrantLock still enforce mutual exclusion around the protected operation.
2. The controlled payment comparison
The October 15 runs used Java 21.0.8, Spring Boot 3.5.12, one carrier and 10 closed-loop k6 virtual users. The synthetic /payments endpoint held a shared lock across a 500 ms operation. Each treatment had three process-level repetitions with 108 completed requests per run.
The JFR profile counted qualifying events at a 20 ms threshold. The throughput and latency values use the 30-second steady window. The shared critical section still admitted one request at a time, giving a capacity bound near 1 / 0.500 s.
The platform-thread control retained the lock. The no-lock control allowed the simulated operations to overlap by dropping mutual exclusion. The historical October 8 eight-carrier baseline belongs to a separate run set and recorded 110 pins per synchronized run.
3. Java 24 and native boundaries
For the Java 24.0.2 comparison (stratum 2), JEP 491 allowed unmounting while holding a monitor. Both lock treatments recorded zero pins and averaged 1.967 steady req/s. In the separate JNI experiments (stratum 3), blocking native calls occupied carriers despite zero recorded pin events. Interpret JFR counts alongside workload and scheduling evidence.
4. Connection pool contention
In the six connection-held runs (stratum 8), Java 21.0.12.1 handled 50 virtual users with embedded H2 and a simulated 300 ms hold after connection acquisition. Increasing the HikariCP pool from one connection to ten changed steady throughput from 3.27 to 32.60 req/s and mean steady p50 from 15.12 to 1.43 seconds. JFR recorded zero pins in both treatments. These results measure pool contention under this workload.
5. Artifacts
The methodology defines the workload strata and admission criteria. The results chapter reports each comparison and the run-level recalculations trace the steady-window lock figures to the k6 results. The persistence analysis script uses k6 order-duration points.