Learn how to write applications that take full advantage of processor power by parallelizing computations and avoiding idle cycles with Java concurrency and multithreading. This course will cover both the concepts behind multithreading and concurrency with real-world examples and provide practical coding examples that demonstrate how to use the capabilities provided by the JDK.
By the end of this course, you will:
Understand the concepts of processes and threads in operating systems and be able to distinguish between the two.
Define threads in Java using Thread, Runnable, and Callable.
Be familiar with Java thread states and the thread lifecycle.
Know the different ways to start threads, including using .start(), ExecutorService, and .parallelStream() capabilities.
Understand the concept behind the ExecutorService thread reuse strategy.
Understand both blocking and non-blocking mechanisms for working with the Future interface.
Learn about daemon threads.
Be able to use the .join() and .interrupt() thread capabilities.
Understand the concept of data race and how to mitigate it using the volatile keyword.
Be familiar with the race condition concept and the mutex strategy to mitigate it.
Know how to write Java code using the synchronized keyword to implement the mutex paradigm.
Understand the compare-and-swap processor instruction and how it is used in the Java atomics package.
Know when and how to use AtomicInteger.
Learn about the ThreadLocal class.
Be able to take thread dumps of the JVM process.