Java Concurrency & Multithreading: beginner to intermediate

Learn Java multi-threading and resolve data and race conditions with volatile, atomics, and synchronized

Ratings 4.88 / 5.00
Java Concurrency & Multithreading: beginner to intermediate

What You Will Learn!

  • A high-level overview of process management by the operating system
  • A high-level overview of thread management by the operating system
  • The fundamental difference between a process and a thread
  • How to define a thread using the Thread subclassing approach
  • How to define a thread by implementing the Runnable interface
  • The different states of a thread and its lifecycle
  • How to start threads using the start() method and the ExecutorService
  • The strategy for reusing threads employed by the ExecutorService
  • How to define a thread by implementing the Callable interface
  • How to use the Future interface in blocking and non-blocking ways
  • The usage of daemon threads
  • The functionality of the Thread's .join() and .interrupt() methods
  • The concept of data race and its details
  • How to use the 'volatile' keyword to avoid data race
  • The concept of mutex / intrinsic lock / monitor
  • The concept of race condition, its details and difference from the data race
  • How to use the 'synchronized' keyword to implement mutex/monitor acquire in Java
  • The concept of the compare-and-swap CPU instruction
  • A high-level overview of the Java atomics package and its relation to compare-and-swap
  • How to use the AtomicInteger class to avoid arithmetic operation race condition
  • The usage of the ThreadLocal class in Java
  • How to take thread dumps of the JVM process
  • How to use the .parallelStream() method in the Java Streaming API

Description

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.

Who Should Attend!

  • Beginner Java developers without prior experience with multi-threading
  • Intermediate and advanced Java developers seeking a deeper understanding of basic concepts behind multi-threading
  • Developers switching from another language to Java who are planning to write multi-threading code
  • Professionals preparing for Java multithreading interviews at the beginner to intermediate level

TAKE THIS COURSE

Tags

  • Concurrency
  • Java
  • Multithreading

Subscribers

65

Lectures

33

TAKE THIS COURSE



Related Courses