/**
   This program runs four threads that deposit and withdraw
   money from the same bank account. 
*/
public class BankAccountThreadTester
{
   public static void main(String[] args)
   {
      BankAccount account = new BankAccount();
      final double AMOUNT = 100;
      final int REPETITIONS = 1000;
      final int DEPOSIT_THREADS = 1000;
      final int WITHDRAW_THREADS = 20;

      for (int i = 0; i < DEPOSIT_THREADS; i++)
      {
         DepositRunnable d = new DepositRunnable(account, AMOUNT * 5, REPETITIONS);
         Thread t = new Thread(d);
         t.start();
      }
      
      for (int i = 0; i < WITHDRAW_THREADS; i++)
      {
         WithdrawRunnable d = new WithdrawRunnable(account, AMOUNT, REPETITIONS);
         Thread t = new Thread(d);
         t.start();
      }
   }
}

