Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- */
- package stadiocalcio;
- import ClassiBase.*;
- /**
- *
- * @author Noemi Buggea
- */
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Risorsa_Condivisa<Abbonato> lista = new Risorsa_Condivisa(10);
- Thread[] produttore = new Thread[2];
- for (int i=0; i<2; i++) {
- produttore[i] = new Thread (new Produttore(lista, "produttore"+i), "PRODUTTORE"+i);
- produttore[i].start();
- }
- Thread[] consumatore = new Thread[2];
- for (int i= 0; i<2; i++){
- consumatore[i] = new Thread(new Consumatore(lista,"consumatore"+i), "CONSUMATORE"+i);
- consumatore[i].start();
- }
- Thread lettore = new Thread(new Lettore(lista, "lettore"), "LETTORE");
- lettore.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement