Class BobBank

  extended by BobBank

public class BobBank
extends Object

This class shows how to synchronice a bunch of people who take money out of the same bank account. Each person is called Bob[i].

This is an example of Map/Reduce. In the "Map" face, in program "main()", the syncrhonization semaphores are set up and the Bob task are created. The "Reduce" face is executed after all the Bob processes are done; in this face the amounts are totalized to verify that exactly the inital amount was withdrawn from the bank.

Field Summary
(package private) static int GaZillion
          I have this much money.
(package private) static int ManyBobs
          A bunch of Bobs compete to drain the bank account.
Constructor Summary
Method Summary
static void main(String[] args)
          Main program.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


static final int GaZillion
I have this much money.

See Also:
Constant Field Values


static final int ManyBobs
A bunch of Bobs compete to drain the bank account.

See Also:
Constant Field Values
Constructor Detail


public BobBank()
Method Detail


public static void main(String[] args)
Main program.