Java Multithreading: Swing and SwingWorker (Video Tutorial Part 15)

If you're doing Swing (GUI) programming in Java, you might want to consider using the SwingWorker class for your multithreading needs. SwingWorker is a ferocious-looking but useful class that's perfec....

Java Multithreading: Interrupting Threads (Video Tutorial Part 14)

What exactly are those pesky InterruptedException s? In this video I show you how to interrupt running threads in Java using the built-in thread interruption mechanism.After starting the video, click....

Java Multithreading: Callable and Future (Video Tutorial Part 13)

How to use Callable and Future in Java to get results from your threads and to allow your threads to throw exceptions. Plus, Future allows you to control your threads, checking to see if they're....

Java Multithreading: Semaphores (Video Tutorial Part 12)

A tutorial on semaphores in Java. Semaphores are mainly used to limit the number of simultaneous threads that can access a resources, but you can also use them to implement deadlock recovery systems s....

Java Multithreading: Deadlock (Video Tutorial Part 11)

The causes of deadlock and two things you can do about it. This video also covers how to write a method that can safely acquire any number of locks in any order without causing deadlock, using the try....

Java Multithreading: Re-entrant Locks (Video Tutorial Part 10)

How to use the ReentrantLock class in Java as an alternative to synchronized code blocks. ReentrantLocks let you do all the stuff that you can do with synchronized, wait and notify, plus some more s....

Java Multithreading: Low-Level Producer-Consumer (Video Tutorial Part 9)

In this tutorial we'll look at how to implement the producer-consumer pattern using low level techniques; namely, wait , notify and synchronized . This isn't the best way to implement a producer-c....

Java Multithreading: Wait and Notify (Video Tutorial Part 8)

A tutorial on wait and notify in Java; low-level multithreading methods of the Object class that allow you to have one or more threads sleeping, only to be woken up by other threads at the right momen....

Java Multithreading: Producer-Consumer (Video Tutorial Part 7)

A tutorial on how to implement the producer-consumer pattern in Java using the ArrayBlockingQueue Java class. Producer-Consumer is the situation where one or more threads are producing data items an....

Java Multithreading: Countdown Latches (Video Tutorial Part 6)

A video tutorial on using the excellent CountDownLatch Java class to synchronize your threads' activities.After starting the video, click the maximise button to make it fullscreen so you can see the....

Java Multithreading: Thread Pools (Video Tutorial Part 5)

A tutorial on how to manage multiple threads in Java using thread pools. With thread pools you can assign a whole gaggle of threads to work through your queue of tasks.After starting the video, click....

Java Multithreading: Lock Objects (Video Tutorial Part 4)

This is the fourth part of our advanced Java multi-threading tutorial. In this tutorial I show you how you can use multiple locks to speed up complex multi-threaded code, sometimes dramatically.After....

Java Multithreading: Synchronized (Video Tutorial Part 3)

This is the third part of our advanced Java multi-threading tutorial. In this tutorial we look at using the synchronized keyword to coordinate actions between threads and prevent them screwing up ea....

Java Multithreading: Volatile - Basic Thread Communication (Video Tutorial Part 2)

The second part of the advanced Java multi-threading tutorial. In this tutorial we look at using the volatile keyword to communicate between threads using flags. We also look at why the potential us....

Java Multithreading: Starting Threads (Video Tutorial Part 1)

Does multithreading seem like a black art to you? This is the first part of an advanced Java tutorial on multithreading that hopefully will help you out. In this tutorial we look at the two ways of st....