This directory contains programs that exercise the
Storage Manager's transaction and concurrency control facilities.
These programs are also examples of how clients can handle server-
initiated aborts and server failures.  The producer program runs a
series of transactions each of which creates one object in a file.  
The consumer program runs a series of transactions,  each of which
prints the contents of one object and destroys it.  
When the last object in the file is consumed, the file is destroyed.

These programs use a single server and operate on a single volume.
The volume may not be a temporary volume.

Here are the steps required to use these programs:

* "make producer consumer" to compile and link the programs.

* Make sure a server is running.  See ../README.

* Make sure you have properly set the client options in your
  ~/.sm_config configuration file.  See ../README.

* "setenv EVOLID 3001"
   where 3001 is the data volume specified by the client "mount"
   option in your ~/.sm_config file.

* "producer p1 num sz" 
	where p1 is a string name for the producer, num is
	the number of objects to produce, and sz is 
	the size of each object in bytes, e.g.,

		producer p1 10 50

* "consumer c1 num" where c1 is a string name for the 
	consumer and num is the number of objects to consume, e.g.,
		consumer c1 10

Multiple producers and consumers can be running simultaneously.  This
introduces the chance for transaction deadlocks, which the server
handles rejecting a lock request.   The application aborts the
transaction.  If more than two producers and two clients are started on
the same machine, they will make little progress because of deadlocks.
The producer and consumer programs retry any transaction that is
aborted.  They also can survive a crash of the server.  If the server
should crash they will try to reconnect every 5 seconds and if
successful will continue transaction processing.  You can demonstrate
this by shutting down a running server with the server terminal command
"shutdown" or using Ctrl-C to simulate a crash.

