Parametrized the code for benchmark Producers
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user