Everyone knows about threading, right? Everyone knows about race conditions and deadlocks, right? Everyone knows how to avoid unexpected data corruption, right? Well, no.
Java has long supported complex multithreaded applications. While the issues related to thread synchronization are usually well understood on a theoretical level (and by no means are specific to Java), in practice many developers lack deep knowledge about the pitfalls.
Thus, courtesy of Core Java author Cay Horstmann, Java Magazine is diving into threading; we have just published the first article in a three-part series. We hope you, and your developer team, benefit from Cay’s rigorous examination of the topic.
Take care, Alan Zeichick Editor in Chief, Java Magazine @zeichick
P.S. GraalVM Enterprise 22.0.0 was released mid-January. There are some pretty significant improvements, including new loop optimizations, as well as changes to supported JDK platform versions. See more in the official release notes.
The newest Java Magazine articles
Synchronization in Java, Part 1: Race conditions, locks, and conditions In most practical multithreaded applications, two or more threads need to share access to the same data. What happens if two threads have access to the same object and each calls a method that modifies the state of the object? The threads can step on each other’s toes. This is the first article in a series adapted from Core Java, Volume I: Fundamentals, 12th Edition, by Cay S. Horstmann.
Design implications of Java’s switch statements and switch expressions Vasily Strelnikov starts with the following assertion: switch statements and switch expressions have different design purposes. To be clear, the older switch statement and the newer switch expression share some syntactical similarities, but they pursue significantly different design goals. Read how to understand the design implications of both constructs.
Natural language processing at your fingertips with OCI Language Oracle Cloud Infrastructure (OCI) AI services offer prebuilt and easy-to-customize machine learning (ML) models. Luis Cabrera explains how these services can help apply AI to applications and business operations. Developers don’t need to have any data science expertise to use them, and the prebuilt models don’t even require training data. This article looks at the Java SDK for one of those services, OCI Language.
How’s your migration progress to Java 17?
Here is a selection of Java Magazine articles and other resources to help on the journey.
Java Magazine is a deep dive into Java and the JVM. Find detailed explanations about the language and the platform written by experts and members of the Java development team.
Join a quarter of a million subscribers in getting useful, authoritative programming information delivered directly to your inbox.