public Consumer(String name, Queue q) { this.name = name; this.q = q; }
public Producer(String name, Queue q) { this.name = name; this.q = q; }
static void Main(string[] args) { Queue q = new Queue(); for (int i = 1; i <= CONST.NPRODUCERS; i++) new Producer("P" + i, q); for (int i = 1; i <= CONST.NCONSUMERS; i++) new Consumer("C" + i, q); Console.ReadLine(); }