Earlier quoted context omitted.
Why would you need an async framework? All blocking I/O in the Java runtime has been changed to yield in a virtual thread.
They added the structured concurrency package because you still need some kind of async framework for concurrency. Maybe the confusion is just the term "framework" as opposed to API? I don't mean a third party library is needed. The built in JDK alone is sufficient but you're still juggling promises/futures and the like.
Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
371–380 of 555 posts
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#372Earlier quoted context omitted.
As a language java's not that bad at this point. But it still has cultural issues. Every java project I encounter tends to be overengineered, has tons of useless boilerplate code and ends up throwing mile-long stack traces as a result. Also, somehow maven manages to be even more unreliable than npm as a package manager. I still frequently encounter situations which seem to only get resolved by throwing away my .m2 fo…
Completely agree with you. I stopped working with Java not because the language or the ecosystem. I stopped working with Java because Java developers and their culture of over-engineering everything defending it as "clean code" and "good practice". But this seems a taboo topic in a culture infested with "good practice gurus".
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#373Earlier quoted context omitted.
If you want to use the Oracle runtime you need to pay Oracle. But the code itself is open source and you can instead use the Azul, Amazon, Red Hat, BellSoft, etc.. runtimes.
Finally got to the answer. So it IS paid from one particular vendor. I understand there are free options. But that makes it a mine in a field if you are not knowledgable enough. It went this deep into threading to really get an ack that there is a big red O' mine in there. And there is one piece that wont run without big red O... :(
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#374Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#375Earlier quoted context omitted.
In my experience the zero to something stage lasts way longer than people think and the cost of using immature and badly suited stacks like Typescript/etc bites way sooner than people think. They just keep pushing through it and telling themselves this is faster and everyone else is doing it so it can't be wrong. Case and point I built a new service recently in Kotlin on JVM. It's a SQL translation gateway that maps…
Fun fact: JDBC was one of the (if not the most important) blocking APIs that people tried to convert or redesign / reimplement as async, and failed miserably. Now, with the advent of virtual threads this should no longer be a problem! JDBC can block all day long, and your app will still scale without a problem.
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#376Earlier quoted context omitted.
Lock contention IIRC
Yeah, poor performance and memory usage. In the Java world, thread locals are java.lang.ThreadLocal, basically a hashmap from thread to variable. Using a ThreadLocal is (usually) a code smell. It's optimized / supposed to be used with just a few threads, not millions.
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#377> However, due to the large number of virtual threads that can be created, developers should use thread-local variables with caution. What is the problem here? Just the per-virtual-thread memory consumption by the variable when it is used (which would be expected)?
However, if suddenly you have a million threads then this optimization doesn't work anymore. Sure, the concept of ThreadLocal still works, but in practice you'll end up creating a million of these heavy objects - something you wanted to avoid!
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#378Earlier quoted context omitted.
Gradle is a better build tool from a purely architectural point of view (though it is quite disliked, I believe mostly due to the ultra-complex android build system being built on top and giving it a bad name), but the Maven repo system is absolutely better than most contemporary repositories, proved by its comparably rare side-chain attacks.
I dislike it because of the ultra-complex build system that over-ambitious devops engineers ended up building in my shop. Our build system was the hardest part of our code base to reason about, which is pretty screwed up.
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#379Earlier quoted context omitted.
Why would you need an async framework? All blocking I/O in the Java runtime has been changed to yield in a virtual thread.
They added the structured concurrency package because you still need some kind of async framework for concurrency. Maybe the confusion is just the term "framework" as opposed to API? I don't mean a third party library is needed. The built in JDK alone is sufficient but you're still juggling promises/futures and the like.
Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency
#380Earlier quoted context omitted.
My experience in small companies told me that younger generation didn’t choose Go because Go is objectively better than Java, but because they actively hate Java for it being out of fashion.
The younger generation chose Go because they're dumb and fell for the Google marketing hype. Most of them have never even used Java outside of school.