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 moment. Extremely useful for avoiding those processor-consuming polling loops.
After starting the video, click the maximise button to make it fullscreen so you can see the code!
Code For This Tutorial
The main program just runs the produce() and consume() methods in different threads.