You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java-24/README.md
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,16 @@ To run each example use: `java --enable-preview --source 24 <FileName.java>`
126
126
* `-XX:+UseZGC-XX:-ZGenerational`: will use generational ZGC and print a warning about obsolete option
127
127
***FlexibleConstructorBodies**
128
128
* re-preview without change
129
+
***SynchronizeVirtualThreads without Pinning**
130
+
* change the virtual threads to release the platform threads when blocked by synchronized methods and statements
131
+
* eliminates nearly all cases of virtual threads being pinned to platform thread
132
+
* scenarios where the virtual threads can be pinned:
133
+
* when inside a synchronized block, if it tries to get another object's monitor, the virtual thread is blocked and pinned until it can adquire the monitor
134
+
* when it tries to invoke a synchronized method that is already locked by another thread, the virtual thread is pinned and blocked until it can adquire the monitor
135
+
* the system property `jdk.tracePinnedThreads` was removed
136
+
* recommendations:
137
+
* use synchronized where practical, since it is more convenient and less error prone
138
+
* use `ReentrantLock` and other APIs when more flexibility is required
129
139
* **Module Import Declarations**
130
140
* re-preview with two changes
131
141
* import module `java.se` will import the entire Java SE API (`java.base`)
0 commit comments