Better exception handling.
[TD_SR.git] / TD1 / exo3 / Main.java
1
2 import java.util.ArrayList;
3
4
5 public class Main {
6
7
8 public static void main (String[] args) {
9 final int BUFFER_SIZE = 1;
10 final int PROD_NUMBER = 20;
11 final int CONS_NUMBER = 20;
12 BufferCirc b = new BufferCirc(BUFFER_SIZE);
13 Thread[] P = new Thread[PROD_NUMBER];
14 Thread[] C = new Thread[CONS_NUMBER];
15 for (int i = 0; i < P.length; i++) {
16 P[i] = new Thread(new Producteur(b));
17 P[i].setName("P" + i);
18 P[i].start();
19 }
20 for (int i = 0; i < C.length; i++) {
21 C[i] = new Thread(new Consommateur(b));
22 C[i].setName("C" + i);
23 C[i].start();
24 }
25 }
26
27 }