public class ProductCustomer {
public static void main(String[] args) {
Storage s = new Storage();
Producer p = new Producer("生产者p", s);
Producer d = new Producer("生产者d", s);
Customer c = new Customer("消费者c", s);
Customer t = new Customer("消费者t", s);
new Thread(p).start();
new Thread(d).start();
new Thread(c).start();
new Thread(t).start();
}
}
public static void main(String[] args) throws InterruptedException {
Storage s = new Storage();
Producer p = new Producer("生产者p", s);
Producer d = new Producer("生产者d", s);
Customer c = new Customer("消费者c", s);
Customer t = new Customer("消费者t", s);
ExecutorService a = Executors.newCachedThreadPool();
a.submit(p);
a.submit(d);
a.submit(c);
a.submit(t);
}
public class ProductCustomer { public static void main(String[] args) { Storage s = new Storage(); Producer p = new Producer("生产者p", s); Producer d = new Producer("生产者d", s); Customer c = n