Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Multithreading and Concurrency in java
Rating: 3.1 out of 5(35 ratings)
241 students

Multithreading and Concurrency in java

Everything you need to know about multithreading and concurrency in java with coding examples
Created byWilky Singh
Last updated 8/2017
English
English [Auto],

What you'll learn

  • Understand parallel processing
  • Will be able to use the concepts in real life scenarios
  • Understand the basics of multithreading and concurrency
  • Will explore the concurrent classes in java

Course content

3 sections30 lectures5h 59m total length
  • Threads-Introduction3:47

    Explore how threads enable multiple activities within a single process, how threads share memory and require synchronization, and how the JVM starts with a main thread and creates auxiliary threads.

  • Threads use8:25

    Learn why and how to use threads in Java for responsive apps. See how background tasks, multi-processor utilization, and safe shared data rely on synchronization and volatile.

  • Creating Threads3:33

    Explore two canonical ways to create threads in Java: extend the thread class or implement Runnable, with run methods and console output, and examine code snippets illustrating thread interactions.

  • Lifecycle of a thread7:07

    Explore the Java thread lifecycle, from new to terminated, including runnable, running, blocked, waiting, and timed waiting states, and how the scheduler manages time slices and notifications.

  • Synchronization18:17

    Learn how Java uses monitors and intrinsic locks to synchronize access to shared resources, preventing race conditions with synchronized blocks and examples of coordinated thread printing.

  • Semaphore6:36

    Explore how semaphores regulate access to a shared resource via permits, using acquire and release, blocking threads until a permit frees, with Java’s concurrent package handling the implementation.

  • Semaphore-Example18:05

    Explore how a semaphore limits shared connections among multiple threads, using a singleton connection, synchronized blocks, and finally blocks to ensure release even when exceptions occur.

  • Interrupting Threads9:19

    Learn how interruption controls threads in Java, including deprecation of stop, using Thread.interrupted() and isInterrupted() to determine status, and handling InterruptedException from sleep or blocking calls.

  • Interrupts-Example15:04

    Demonstrates interrupting a running thread, checking the interrupt flag, using sleep and InterruptedException, and joining threads to see how an interruption affects a time-consuming loop.

  • ReentrantLock5:47

    Explore reentrant lock in Java as a mutually exclusive lock with fairness, tryLock (with timeout), and interruptible locking, offering more control than synchronized.

  • Reentrant Lock-Example16:32

    Explore a java reentrant lock example with two threads incrementing a shared counter by 10000, producing a total of 20000, using try/finally unlock and a condition wait/notify mechanism.

  • DeadLock3:43

    Understand how deadlock occurs in programming and learn practical prevention techniques, including non-overlapping locks, lock ordering, lock timeouts, and single-thread strategies.

  • DeadLock-Example14:06

    Explains a deadlock example with two threads and two locks, showing how acquiring resources in opposite order creates deadlock, and how a consistent lock acquisition order prevents it.

  • Wait and Notify15:07

    Learn how wait and notify coordinate threads in Java using synchronized blocks and intrinsic locks, pause with sleep, resume after user input via scanner, and understand join behavior.

  • LowLevel Synchronization-114:44

    Explore low-level synchronization in java through a producer and consumer on a shared list guarded by a synchronized block, using wait/notify to enforce a ten-element limit.

  • LowLevel Synchronization-27:17

    Demonstrates a low-level producer-consumer using a synchronized lock to coordinate a shared list, with size checks preventing overfill and blocking when empty.

  • Starvation18:45

    Starvation occurs when a thread repeatedly loses access to a shared resource due to higher priority threads; the lecture explains mutex synchronization, infinite loops, and avoidance strategies.

Requirements

  • Basic understanding of java
  • Any IDE like eclipse ,Intellij,netbeans etc.
  • Willing to learn
  • Patience to watch the video till end and practice the stuffs by yourself

Description

This course contains the basics of multithreading and concurrent programming with utility classes from concurrent package of the java framework . We will consider the low level concepts such as threads, synchronization and locks. One section is dedicated to concurrent library that includes built in classes and interfaces that we can use when implementing multithreaded applications. We will do practical and examples in the discussion.

The concept of multithreading is very important and very essential when you are working in large applications or on mobile app development. But at the same time it is very complex to understand and implement so we have tried our best to cover everything you need to know about the concepts by discussing the theory in detail and then doing the coding part of the same.

And if you have any issues we will always be there to guide you and you can also discuss the queries in the forum so that you can get to know about the various problems and there respective solutions by other students.

Thanks for joining my course,

Best of luck! and Happy  Coding

Who this course is for:

  • Those who wants to learn multithreading
  • Those who wants to explore the concurrency packages in java
  • This course is meant for students who want to get a good grasp on multithreading in java and want to learn the differences and there usability