Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

The Producer-Consumer Problem - Part IV

Running the following program will result into a race condition:

// {...}
public class Main {
public static void main(String args[]) throws Exception {
new Thread(new Producer(), "produce").start();
new Thread(new Consumer(), "consume").start();
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content