Skip to main content
PreparationZone Logo
PreparationZone
Back to Java

Java · Hard · Pro

Why synchronized can pin virtual threads — alternatives?

JavaConcurrencyStaff
Model answerPreview

synchronized on virtual threads

When a virtual thread enters synchronized and blocks, it pins its carrier. JDK improvements reduce some cases, but heavy locking still limits…