previous | start | next

Producer Thread

int i = 1;
while (i <= repetitions)
{
if (!queue.isFull())
{
queue.add(i + ": " + greeting); i++;
}
Thread.sleep((int)(Math.random() * DELAY));
}



previous | start | next