... continued

This lesson explains how to solve the producer-consumer problem using a mutex.

Busy wait solution using Lock

In the previous lesson, we solved the consumer producer problem using the synchronized keyword, which is equivalent of a monitor in Java. Let's see how the implementation would look like, if we were restricted to using a mutex. There's no direct equivalent of a theoretical mutex in Java as each object has an ...