Timing with threads

So what is a thread? You can think of threads in Java programming just like threads in a story. In one thread of a story, we have the primary character battling the enemy on the front line, and in another thread, the soldier's family are getting by, day to day. Of course, a story doesn't have to have just two threads. We could introduce a third thread. Perhaps the story also tells of the politicians and military commanders making decisions. These decisions subtly, or not so subtly, affect what happens in the other threads.

Threads in programming are just like this. We create parts/threads in our program and they control different aspects for us. We introduce threads to represent these different aspects because of the following ...

Get Android Game Programming: A Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.