    01: /**
    02:    This program runs two threads in parallel.
    03: */
    04: public class ThreadTester
    05: {
    06:    public static void main(String[] args)
    07:    {
    08:       BoundedQueue<String> queue = new BoundedQueue<String>(10);
    09:       final int GREETING_COUNT = 100;
    10:       Runnable run1 = new Producer("Hello, World!",
    11:             queue, GREETING_COUNT);
    12:       Runnable run2 = new Producer("Goodbye, World!",
    13:             queue, GREETING_COUNT);
    14:       Runnable run3 = new Consumer(queue, 2 * GREETING_COUNT);
    15:
    16:       Thread thread1 = new Thread(run1);
    17:       Thread thread2 = new Thread(run2);
    18:       Thread thread3 = new Thread(run3);
    19:
    20:       thread1.start();
    21:       thread2.start();
    22:       thread3.start();
    23:    }
    24: }
    25: