Java Concurrency - Threads

How Do Threads Work? There are two primary ways to create a thread: Subclass Thread by extending the Thread class and overriding it’s run() method Implement a Runnable class implementation as an anonymous class or Lambda expression to a Thread constructor. This is preferred since you can build the task logic and separate it from the actual execution (Thread). Starting a Thread uses the .start() method. Calling run() from the implementation only executes the code in the thread, not run the actual thread. ...

January 13, 2025 · 2 min · Me

Java Concurrency Intro

Deep Dive Into Java Concurrency This is the start of a series where I explore the nuances of Java concurrency and how it plays a part in enterprise/large-scale applications. While I work with Java daily, the issue of concurrency doesn’t always come up. When it does, however, it is a tricky subject and requires a lot of careful navigation to make sure the application is as efficient and operational as possible (follows CAP Theorem). ...

January 13, 2025 · 2 min · Me