记录一下学习过程中的点滴~
class ProducerConsumerDemo
{
public static void main(String[] args)
{
Resource res = new Resource();
Producer pro = new Producer(res);
Consumer con = new Consumer(res);
Thread d1 = new Thread(pro);
Thread d2 = new Thread(pro);
Thread d3 = new Thread(con);
Thread d4 = new Thread(con);
d1.start();
d2.start();
d3.start();
d4.start();
}
}