2 import java
.util
.ArrayList
;
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
);
20 for (int i
= 0; i
< C
.length
; i
++) {
21 C
[i
] = new Thread(new Consommateur(b
));
22 C
[i
].setName("C" + i
);