
Explore java concurrency and multithreading with hands-on demonstrations of threads, synchronization, inter-thread communication, and thread pools, then cover concurrent collections, immutable objects, atomic variables, and deadlocks.
Explore multithreading and concurrency, including threads, blocking operations, and timeslicing, and learn to create Java threads via Runnable or extending Thread, with examples like a web server.
Learn to create threads by extending Thread and implementing Runnable in Eclipse. Run and print each thread's name, including the main thread, Thread-0, and Thread-1.
Explore how thread timing causes race conditions and data races, leading to unpredictable behavior in multithreaded apps. Learn the two conditions for data races and try a practical coding challenge.
Explore timing challenges in Java concurrency by creating ten threads that log their IDs; observe that thread execution order differs from launch order due to scheduling.
learn how synchronization uses a critical section and the synchronized keyword to enforce mutual exclusion, via a monitor with a lock and unlock, and waiting threads.
Learn to synchronize threads with a shared counter to prevent race conditions in increment and decrement, then explore how sleep can reintroduce issues after synchronization.
Use a synchronized block on the counter object to create a critical section, ensuring only one thread accesses the counter at a time and prints zero, with alternatives discussed.
Explore how volatile enforces visibility by reading the main memory in multi-threaded access, and how synchronized uses a happens-before constraint with lock and unlock inside a critical section.
Demonstrate using volatile to share a static counter between writer and reader threads, ensuring visibility of increments. Switching to static volatile int counter makes the reader observe changes.
Compare volatile and synchronized in Java concurrency to choose for atomic operations with single writer versus multithreaded non-atomic updates; even thread-safe objects may require synchronization for non-atomic interactions.
Explore a thread state diagram showing new, runnable, blocked, waiting, timed waiting, and terminated states, with actions for transitions, how locks influence inter-thread communication, and how timeouts return to runnable.
Show how join makes the main thread wait for a thread to finish, ensuring 'Exiting thread one' prints before 'Exited thread one'.
Explore producer and consumer pattern and how threads synchronize with a queue buffer. Use wait and notify, or notifyAll for multiple consumers, inside a synchronized block to coordinate inter-thread communication.
Explore inter-thread communication between a producer and a consumer using wait and notify, synchronized blocks, and a shared MessageBean that carries a produced message between threads.
Learn how interrupts stop a thread, manage status with Thread.interrupted() and Thread.isInterrupted(), re-assert interruption on the current thread when needed, and decide to throw or preserve status in blocking calls.
Start a thread, sleep to trigger InterruptedException, handle and log the interruption, then return; plus a challenge to implement a custom blocking call that throws InterruptedException.
Replace sleep with a custom blocking loop that can throw InterruptedException, using Thread.yield to avoid busy waiting, check for interrupts, and print 'Thread interrupted' when caught.
Learn to create immutable classes that are thread-safe by making fields private and final, forbidding setters, and returning copies of internals.
Learn to build an immutable product class with final fields and copied inputs, remove setters, and return copies or an unmodifiable list to defend against tampering of ingredients.
Learn how to use Collections.unmodifiableList() to return an unmodifiable list and see that attempting to add an item via the getter (for example, adding chilli) throws an exception.
Explore atomic variables such as AtomicBoolean, AtomicInteger, AtomicLong, AtomicReference, LongAdder, and LongAccumulator, and learn how compare-and-swap enables lock-free, faster updates with correct usage vs get and set.
Explore atomic operations by creating an AtomicInteger and an AtomicReference, perform increment, add, and compare-and-set to safely update values; learn why final references prevent race conditions and enable two-step updates.
Explore liveness failures in multithreading, including deadlock, starvation, and livelock, with explanations of how opposite-lock acquisition, priorities, and never-released locks hamper progress.
Explore how two threads and two lock objects can cause a deadlock when each thread acquires one lock in opposite order, with sleep creating the timing that blocks both threads.
Explore how to design thread-safe objects for concurrent environments, compare lock stripping and CAS-based collections, leverage unmodifiable collections to safeguard data, and understand fail-fast and fail-safe iterators.
Compare thread-safe collections: a synchronized map via Collections.synchronizedMap() versus a ConcurrentHashMap, noting how full synchronization slows calls and how concurrent maps enable better multithreading. Understand Map versus ConcurrentMap and putIfAbsent.
Explore how blocking queues enable producer and consumer communication in multithreading, using put and take with offer and poll as timeouts, and learn LinkedBlockingQueue and ArrayBlockingQueue implementations.
Demonstrates how a producer and a consumer coordinate via a blocking queue, using queue.put and queue.take to exchange messages while the producer sleeps to regulate flow.
Explore how thread pools mitigate thread management drawbacks by capping threads, reusing threads via executors, and submitting runnable or callable tasks that return futures.
Create a fixed thread pool of multiple threads, implement a callable task returning integers, use futures to wait for results, print random numbers, and compare thread pool options.
Explore using the executor service with runnable tasks and thread pools to submit work that prints random numbers, without returning results, while noting the contrast with callable and futures.
This is a complete course about Java Multithreading. If you want to learn more about concurrency in Java, you are in the right place! This is the course for you!
In this course, you will learn all secrets and tricks about multithreading. You will see in practice how each feature works, with straight to the point examples, and no-frills. You will see with your own eyes how things work, rather than having to believe in my own words.
I spent my last 20 years in IT as a consultant and I can now deliver these concepts in the most effective way. I designed this course like a journey for you, and I filled it up with a lot of visual content, as learning shouldn't be boring. I believe in visual-learning and when you see something, you can hardly forget it.
After this course, you will be able to build your own multithreading applications with absolute confidence and you will be able to better understand someone else's code, being more aware of what is behind every technical choice. You will be able to develop more bug-free code and you will be able to improve performances with parallel computing. Every section is like a piece of a puzzle that at the end is going to build the big picture, which will give you more understanding and certainty.
This course is completely hands-on and filled with programming challenges. There are 28 projects that you can download, modify and try by yourself.
If you just know the basics about java, you are welcome, as I made things very simple for you. And if you are an expert, you are welcome too, as you will learn more advanced features and add the missing pieces .
Tools required:
A recent version of Eclipse. In the course I'm using the version 2020-06, but any recent version will work fine.
A recent version of Java. In the course I'm using Java 14, but any versions from Java 8 included onwards will work fine.
Extra things that come with this course:
28 projects for Eclipse
Zip files for each project
GitHub links for each project (optional for who knows Git)
Quick reference documents, to review key concepts.
Plenty of quizzes.
Hands-on challenges.
Videos with plenty of images and diagrams to learn key concepts.
Plenty of screencasts with demonstrations.
Udemy Money back guarantee
I'm sure you will enjoy the course and you will learn a lot out of it. I guarantee I will do my best to help you get through it and get the most from it. But if, for any reasons, you feel otherwise or you change your mind: on each Udemy course there is a 30 day money-back guarantee! So, there is nothing to risk anyway!
ENROLL NOW!