Chapter 4. Lifecycle
APIs Used in This Chapter
The Class java.lang.Thread
The Class Extensions.InterruptibleThread
The Interface java.lang.Runnable
In which the reader is treated to a comprehensive explanation of the intricacies in the life of a thread—birth, life, and death— even death by vile cancellation. A small program that illustrates all these stages concludes the chapter.
The fundamental paradigm of threads is the same in all the libraries. In each, the program starts up in the same fashion as single-threaded programs always have—loading the program, linking in the dynamic libraries, running any initialization sections, and finally, starting a single thread running
main() (the main thread). The main function ...