CHAPTER 17: Threads and Locks Previous
Previous
Java Language
Java Language
Index
Index
Next
Next

17.12 Threads

Threads are created and managed by the built-in classes Thread (S20.20) and ThreadGroup (S20.21). Creating a Thread object creates a thread and that is the only way to create a thread. When the thread is created, it is not yet active; it begins to run when its start method (S20.20.14) is called.

Every thread has a priority. When there is competition for processing resources, threads with higher priority are generally executed in preference to threads with lower priority. Such preference is not, however, a guarantee that the highest priority thread will always be running, and thread priorities cannot be used to reliably implement mutual exclusion.

© 1996 Sun Microsystems, Inc. All rights reserved.