We have seen two ways to spawn a thread, using the
AsyncTask classes. When two or more threads access the same data, you need to make sure the data types support concurrent access. The Java language defines many classes in the
java.util.concurrent package for that purpose:
You will have to carefully select your data types based on your application's requirements. Also, the fact that they are concurrent implementations does not necessarily imply that operations are atomic. In fact, many operations ...