Last active
April 19, 2016 10:48
-
-
Save MarounMaroun/34e55a133ba5548f8a6e895bb6125db8 to your computer and use it in GitHub Desktop.
Runs a simulation of producer-consumer pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Main { | |
| public static void main(String[] args) { | |
| Data d = new Data(); | |
| Thread p1 = new Thread(new Producer(d, 1)); | |
| Thread c1 = new Thread(new Consumer(d, 1)); | |
| Thread c2 = new Thread(new Consumer(d, 2)); | |
| p1.start(); | |
| c1.start(); | |
| c2.start(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment