Parametrized the code for benchmark Producers

This commit is contained in:
selva.andre
2012-09-04 13:58:33 +02:00
parent e56662fbef
commit a52845a4c2
@@ -24,8 +24,9 @@ public class Main {
//force wait to let the consumer be registered before the producer //force wait to let the consumer be registered before the producer
Thread.sleep(1000); Thread.sleep(1000);
int len = Producer.PUB_LOOP / NUM_CONCURRENT_PRODS; int len = Producer.PUB_LOOP / NUM_CONCURRENT_PRODS;
producerPool.submit(new Producer("Prod1", 0, len)); for (int i = 0; i < NUM_CONCURRENT_PRODS; i++) {
producerPool.submit(new Producer("Prod2", len, len)); producerPool.submit(new Producer("Prod " + i, i * len, len));
}
consumerPool.shutdown(); consumerPool.shutdown();
producerPool.shutdown(); producerPool.shutdown();