How virtual thread is parking?

469 views Asked by At

How are virtual threads parked in Project Loom, specifically in scenarios other than LockSupport.park()? I've noticed that LockSupport.park() is used in FutureTask and CompletableFuture, but what about situations involving I/O operations? I came across this code snippet (link: https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp#L1174-L1226) involving continuation yield intrinsic, but I'm unclear about where this intrinsic fits into the picture, as I understand intrinsics are typically used for performance optimization. Additionally, I'm curious about ObjectMonitor, which use pthread_mutex with cond (link: https://github.com/openjdk/jdk/blob/f61499c73fe03e2e3680d7f58a84183364c5c5ac/src/hotspot/share/runtime/objectMonitor.cpp#L757), how does it work with virtual thread where pthread doesn't exist?

0

There are 0 answers