I. Overview
Priority of the thread:
When we create a thread, we specify a priority that affects the chance that the thread will execute.
The meaning of the opportunity is that the thread executes more, but there is no guarantee that the thread will execute more times than the lower priority thread for a certain amount of time.
Priority: It can only represent a probability when the priority is guaranteed to be valid during a long run.
The ID of the thread:
When the JVM is created, it gives the thread an ID, which is the number given to the default thread name. (Available in the source code).
In fact, like the name of the thread, the ID is just a property that identifies the thread.
Two. Role and complement of priorities
We can not rely on the priority to determine the order of execution of threads, and this will depend on the synchronization of threads to complete.
005 thread ID and Thread priority