New Thread Management Changes coming in CFNext The...
# adobe
m
New Thread Management Changes coming in CFNext The next version of Adobe ColdFusion will run on JDK21, and as some of you may know, this version brings with it some major improvements, but also some changes which may have an impact on your code. @Charvi has written up a blog here which gives a high level overview of what's changing in JDK21 when it comes to thread management, and some of the options we're looking at to help our users to transition to the new paradigm. If you're a user of threads in ACF, and especially if you're currently using cfthread terminate, you'll want to read this and give us your feedback. https://coldfusion.adobe.com/2024/05/thread-management-with-jdk21-whats-changing-and-features-to-look-forward-to/
👍 4
s
One thing to be aware of is that any (Java) code using
synchronized
can cause virtual threads to "pin" to an O/S thread which can quickly choke your system. A really bad example of this currently is MySQL's JDBC driver. In theory, virtual threads are great for I/O bound tasks because any I/O should cause a vthread the "park" and yield to another vthread, greatly increasing the potential concurrency in your application. Unfortunately, if you perform MySQL JDBC ops on vthreads, you're quickly going to tank your system...
👍 1
m
This is good to know Sean.
b
Java's new threading stuff is pretty cool. Glad to see Adobe jumping on it
s
We have (almost) everything on JDK 21 at work and we've been experimenting with vthreads since they first previewed (in JDK 19?) but we can't adopt them wholesale due to the MySQL driver issue (they know about it and they're working on it). You can switch
synchronized
code to using
ReentrantLock
(and semaphores to control concurrent access to resources if necessary) but a lot of Java libraries -- especially older ones -- use
synchronized
all over the place 😞 Clojure made changes to their compiler recently to make it friendlier to vthreads, which is why I brought it up here.
m
The MySQL issue is definitely a concern, but I wonder how many folks are in the intersection of using cfthread AND MySQL. I honestly don't know, my gut feeling would be that you'd be more likely to be using something like MSSQL or Oracle, but maybe I am underselling MySQL here. Curious if any customers are actually doing that in production today.
e
All the large production items are either Microsoft or Oracle, while many smaller items are MySQL/Mariadb, Postgres, and H2, with a handful of NoSQL solutions. By volume of data, there is nearly a 50 /50 split between enterprise-boxed RMDBs and open-source.
❤️ 2