You want to improve performance by running your code on multiple threads? Then this training is for you!
This workshop covers the best ways to run code in parallel in Java today. We will deep dive into the concept of a thread pool executor, heavily used over the past 20+ years and present in every major modern Java framework. We'll see how they work, how big should you size them, how to avoid blocking precious threads, as well as pitfalls in exception handling, parallel streams, and Thread Locals.
This is the recording of a 3.5 hours live webinar that took place in December 2020.
- Thread - Fundamentals
- Why not to manually create threads
- Thread Pool Executors: deep explanations
- Sizing a Thread Pool: Goetz Formula
- @Async (Spring)
- Handle HTTP Requests Asynchronously
- parallelStream Best Practices
- Thread Locals Best Practices
- Handling Exceptions from other threads
What to expect?
We will solve together a series of exercises in Java (70% of the time) exploring the behavior of the tools we cover, discussing their intended purpose, pros and cons of each in detail. The coding will be backed by explanations of key theoretical concepts and demonstrated whenever via performance benchmarks. We will make some brief reference to the Spring Framework, but all the ideas are directly applicable to any other frameworks in Java: JavaEE, Quarkus and Micronaut.
After following this workshop, you'll acquire a solid knowledge about multithreading and you will take away at least a dozen of key practical techniques that you can apply to any real-life work involving multithreading. Expect an intense experience, as usual!
Disclaimer: Concurrency is a huge topic. The training does NOT cover concurrency control, race bugs, or deadlocks, nor ReactiveX or Akka Actors. Those might become the topic of another a future training.
Any Java developer, ideally with some prior contact with multi-thread code.
I would recommend you get yourself a black coffee and you pay close attention to the discussion, stop the recording at any moment and try to reproduce what I'm doing on your own machine. In the resources section you can find the code zipped together with the git history, so you can explore my commits if you get lost. If still can't make it work, please don't hesitate to email me!
To run the project you will need a Java 8+ SDK installed, a decent IDE, and access to GitHub and Maven Central.
You can find more details about completable futures and parallel streams online, such as these:
P.S.: The content is distilled from my 2-days (16-hours) Performance training. If you are interested in a private dedicated session for your company, please find here my entire curricula and contact details.