Main.java 516 Bytes
Newer Older
Luca Arrotta's avatar
Luca Arrotta committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package producerConsumer;

public class Main {
    public static void main(String[] args) {
        Queue q = new Queue();
        Producer p1 = new Producer("p1", q);
        Producer p2 = new Producer("p2", q);
        Producer p3 = new Producer("p3", q);
        Consumer c1 = new Consumer("c1", q);
        Consumer c2 = new Consumer("c2", q);
        new Thread(p1).start();
        new Thread(p2).start();
        new Thread(p3).start();
        new Thread(c1).start();
        new Thread(c2).start();
    }
}