package threadPoolConcurrency; import java.util.concurrent.*; public class ProvaThreadPool { public static void main(String[] args) { final int N = 16; // numero dei task da calcolare final int T = 4; // numero minimo di thread nel pool // final int MAX_T = 8; // numero massimo di thread nel pool ExecutorService tpe = null; // creazione dell'esecutore tpe = // new ThreadPoolExecutor(T,MAX_T,10000L,TimeUnit.MILLISECONDS, new LinkedBlockingQueue()); Executors.newFixedThreadPool(T); // creazione del repository per i risultati Repository results = new Repository(); // creazione del thread stampatore Stampatore stampatore = new Stampatore(results); stampatore.start(); // funzione da calcolare Compute fun = new FunzioneSemplice(); // questo sostituisce il codice del generatore: for(int i=0; i