-
A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.
-
Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority. Each thread may or may not also be marked as a daemon.
-
When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named
main
of some designated class). The Java Virtual Machine continues to execute threads until either of the following occurs: - 线程是一个在程序执行的线程。java虚拟机总允许一个应用有多条执行线程同时在运行。
- 每一个线程有一个优先权。高优先级的线程在优先执行对于低优先级的线程。每一个线程可能或者不可能被标记为后台程序。
- 当java虚拟机开始了,经常有一个单一不是后台程序的(非守护的)线程。
- java虚拟机继续执行线程直到下列的发生。