<howto>
h1.  AtomicInteger Recipe

h2.  Summary

This example shows a simpler way to cluster an integer value using Terracotta.  It uses [AtomicInteger|http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/atomic/AtomicInteger.html], which is internally synchronized, and therefore does not need external synchronization, as does an int, as seen in the Hello World example.

h2.  How to run
(Note: A Terracotta Server instance is always required to run Terracotta.  dso-java(.sh|.bat) is a wrapper script that adds Terracotta to standard java)

*Node 1:*
{code}
$ javac *.java
$ start-tc-server &amp;
$ dso-java Main
Count is: 1
{code}

*Node 2:*
{code}
$ dso-java Main
Count is: 2
{code}
</howto>
