One, the most important, is the priority of the thread, the other is the daemon flag. New threads inherit the priority and daemon flag from the thread that created it. The scheduler determines which thread should be executed by analyzing the priorities of all threads. Those with the highest priority are allowed execution before any lower priority threads. The scheduler can be of two flavors, preemptive or non-preemptive.
Preemptive schedulers give a certain time-slice to all threads running on the system.
Non-preemptive schedulers decide which thread should run and run it until the thread is complete. The thread has full control of the system for as long as it likes. Depending on the system Java is running on, the scheduler can be either preemptive or non-preemptive. The scheduler determines which thread should be running based on a priority number assigned to each thread. The range of priorities is from 1 to 10.