
Multi-core and multi-CPU systems enable true parallelism by letting independent cores execute tasks simultaneously, with memory storing state to prevent conflicts.
Learn how executor service submits threads as callables, offers shutdown capabilities, and abstracts thread management, enabling reusable threads through fixed thread pool, cached thread pool, or single thread executor.
Contrast blocking and non-blocking calls and introduce callable for thread tasks that return a result. Learn how futures from an Executorservice enable checking isDone and using get with optional timeout.
Submit sushi and coffee callables to a cached thread pool and compare blocking waits with concurrent execution. See how article work overlaps with task completion for efficiency.
Explore joining and interrupting in Java threads: join blocks until a thread finishes (with timeout), interrupt toggles the flag or raises an exception, and executor service cannot be joined.
Discover how CPU bit width defines data representation, from four-bit to sixty-four-bit processors, and how registers, memory transfers, and multi-step operations enable handling larger numbers.
Examine a race condition where multiple threads subtract croissants and bagels from shared stock, revealing non-atomic subtraction errors and the need for atomic operations.
Explore the compare-and-swap atomic instruction, its address, expected value, and update value inputs, and how it enables lock-free updates in multithreading by retrying until success.
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.
This course is officially owned and provided by Yestastic Tech Labs LLC.